2014-04-15 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-prof / pr44777.c
blob1c4da7f5f7dc6619562647f31e8744f44e4045cc
1 /* PR middle-end/44777 */
2 /* { dg-options "-O0" } */
3 /* A variant of gcc.c-torture/execute/comp-goto-2.c. */
5 extern void abort (void);
6 extern void exit (int);
8 #ifdef STACK_SIZE
9 #define DEPTH ((STACK_SIZE) / 512 + 1)
10 #else
11 #define DEPTH 1000
12 #endif
14 #if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
15 int
16 x (int a)
18 __label__ xlab;
19 void y (int a)
21 void *x = &&llab;
22 if (a==-1)
23 goto *x;
24 if (a==0)
25 goto xlab;
26 llab:
27 y (a-1);
29 y (a);
30 xlab:;
31 return a;
33 #endif
35 int
36 main ()
38 #if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
39 if (x (DEPTH) != DEPTH)
40 abort ();
41 #endif
42 exit (0);