aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/testsuite/gcc.dg/pr42611.c
blob: c33e248caf500f59da1e3ec42d366c13fbcf6dd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* PR other/42611 */
/* { dg-do compile } */
/* { dg-options "" } */

#define L \
  (sizeof (__SIZE_TYPE__) == 1 ? __SCHAR_MAX__				\
  : sizeof (__SIZE_TYPE__) == sizeof (short) ? __SHRT_MAX__		\
  : sizeof (__SIZE_TYPE__) == sizeof (int) ? __INT_MAX__		\
  : sizeof (__SIZE_TYPE__) == sizeof (long) ? __LONG_MAX__		\
  : sizeof (__SIZE_TYPE__) == sizeof (long long) ? __LONG_LONG_MAX__	\
  : __INTMAX_MAX__)
struct S { int a; char b[L]; };

void
foo (void)
{
  struct S s;				/* { dg-error "is too large" } */
  asm volatile ("" : : "r" (&s));
}