view gcc/testsuite/gcc.dg/pr42611.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 84e7813d76e9
children
line wrap: on
line source

/* 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]; };	/* { dg-error "type .struct S. is too large" } */

void
foo (void)
{
  struct S s;   /* { dg-warning "size of .s. \[0-9\]+ bytes exceeds maximum object size \[0-9\]+" } */
  asm volatile ("" : : "r" (&s));
}