Adjust scan string for PIE
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-prof / pr34999.c
blob4ec42790e57e969ec1d68147b65cae4135d53be5
1 /* Same test as built-in-setjmp.c. Includes the case where
2 the source block of a crossing fallthru edge ends with a call. */
3 /* { dg-require-effective-target freorder } */
4 /* { dg-options "-O2 -freorder-blocks-and-partition" } */
6 extern int strcmp(const char *, const char *);
7 extern char *strcpy(char *, const char *);
8 extern void abort(void);
9 extern void exit(int);
11 void *buf[20];
13 void __attribute__((noinline))
14 sub2 (void)
16 __builtin_longjmp (buf, 1);
19 int
20 main ()
22 char *p = (char *) __builtin_alloca (20);
24 strcpy (p, "test");
26 if (__builtin_setjmp (buf))
28 if (strcmp (p, "test") != 0)
29 abort ();
31 exit (0);
35 int *q = (int *) __builtin_alloca (p[2] * sizeof (int));
36 int i;
38 for (i = 0; i < p[2]; i++)
39 q[i] = 0;
41 while (1)
42 sub2 ();