2018-06-05 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-prof / pr59003.c
blob1c7d5e07fb9e23097b263739a1af641de8ac4829
1 /* PR target/59003 */
2 /* { dg-options "-O2" } */
3 /* { dg-options "-O2 -mtune=amdfam10" { target i?86-*-* x86_64-*-* } } */
4 /* { dg-options "-O2 -fno-common" { target hppa*-*-hpux* } } */
6 __attribute__((noinline, noclone)) void *
7 foo (void *p, unsigned int q)
9 return __builtin_memset (p, 0, q * 4UL);
12 char buf[128] __attribute__((aligned (32)));
14 int
15 main ()
17 int i;
18 for (i = 0; i < 100000; i++)
19 foo (buf + 4, 1 + (i & 1));
20 for (i = 0; i < 128; i++)
22 buf[i] = 'X';
23 asm volatile ("" : : : "memory");
25 foo (buf + 32, 7);
26 for (i = 0; i < 128; i++)
27 if (buf[i] != ((i < 32 || i >= 32 + 28) ? 'X' : 0))
28 __builtin_abort ();
29 return 0;