Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.c-torture/compile/pr37056.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
/* { dg-skip-if "ptxas times out" { nvptx-*-* } { "-O2" "-Os" } { "" } } */ extern void abort (void); static union { char buf[12 * sizeof (long long)]; } u; int main () { int off, len, i; char *p, *q; for (off = 0; off < (sizeof (long long)); off++) for (len = 1; len < (10 * sizeof (long long)); len++) { for (i = 0; i < (12 * sizeof (long long)); i++) u.buf[i] = 'a'; p = (__extension__ (__builtin_constant_p ('\0') && ('\0') == '\0' ? ({void *__s = (u.buf + off); __s;}) : __builtin_memset (u.buf + off, '\0', len))); if (p != u.buf + off) abort (); for (i = 0; i < off; i++, q++) if (*q != 'a') abort (); } return 0; }