view gcc/testsuite/gcc.dg/pr42611.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +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));
}