2014-07-29 Ed Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr33017.c
blob851fe71f8607a2f266f2370cc17b720ec71cc3d3
1 /* PR tree-optimization/33017 */
2 /* { dg-do run } */
3 /* { dg-options "-O2 -ftree-vectorize" } */
5 extern __SIZE_TYPE__ strlen (const char *);
6 extern void abort (void);
8 char *
9 __attribute__((noinline))
10 foo (const char *string)
12 int len;
13 static char var[0x104];
14 int off;
15 len = strlen (string);
16 for (off = 0; off < 64; off++)
17 var[len + off + 2] = 0x57;
18 return var;
21 int
22 main (void)
24 char *p = foo ("abcd");
25 int i;
26 for (i = 0; i < 0x104; i++)
27 if (p[i] != ((i >= 6 && i < 70) ? 0x57 : 0))
28 abort ();
29 return 0;