summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other/large-size-array.C
blob: 9614fb1253932e6ea934bfea222cdf67cd0525c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* { dg-do compile } */
#include <limits.h>

#ifdef _WIN64
#define DIM ULLONG_MAX>>1
#else
#ifdef __LP64__
#define DIM UINT_MAX>>1
#else
#define DIM USHRT_MAX>>1
#endif
#endif

int
sub (int *a)
{
  return a[0];
}

int
main (void)
{
  int a[DIM][DIM];  /* { dg-error "size of array 'a' is too large" } */
  return sub (&a[0][0]);  /* { dg-error "declared" } */
}