modernc.org/ccgo/v3@v3.16.14/lib/testdata/gcc-9.1.0/gcc/testsuite/gcc.c-torture/compile/pr37056.c (about)

     1  /* { dg-skip-if "ptxas times out" { nvptx-*-* } { "-O2" "-Os" } { "" } } */
     2  extern void abort (void);
     3  
     4  static union {
     5      char buf[12 * sizeof (long long)];
     6  } u;
     7  
     8  int main ()
     9  {
    10    int off, len, i;
    11    char *p, *q;
    12  
    13    for (off = 0; off < (sizeof (long long)); off++)
    14      for (len = 1; len < (10 * sizeof (long long)); len++)
    15        {
    16  	for (i = 0; i < (12 * sizeof (long long)); i++)
    17  	  u.buf[i] = 'a';
    18  	p = (__extension__ (__builtin_constant_p ('\0') && ('\0') == '\0'
    19  			    ? ({void *__s = (u.buf + off); __s;})
    20  			    : __builtin_memset (u.buf + off, '\0', len)));
    21  	if (p != u.buf + off)
    22  	  abort ();
    23  	for (i = 0; i < off; i++, q++)
    24  	  if (*q != 'a')
    25  	    abort ();
    26        }
    27    return 0;
    28  }
    29