Debian Codegraph @

gcc/testsuite/gcc.c-torture/execute/comp-goto-2.c

raw
1 /* { dg-require-effective-target label_values } */
2 /* { dg-require-effective-target trampolines } */
3 /* { dg-add-options stack_size } */
4 /* { dg-additional-options "-std=gnu89" } */
5
6 /* A slight variation of 920501-7.c. */
7
8 #ifdef STACK_SIZE
9 #define DEPTH ((STACK_SIZE) / 512 + 1)
10 #else
11 #define DEPTH 1000
12 #endif
13
14 x(a)
15 {
16 __label__ xlab;
17 void y(a)
18 {
19 void *x = &&llab;
20 if (a==-1)
21 goto *x;
22 if (a==0)
23 goto xlab;
24 llab:
25 y (a-1);
26 }
27 y (a);
28 xlab:;
29 return a;
30 }
31
32 main ()
33 {
34
35 if (x (DEPTH) != DEPTH)
36 abort ();
37
38 exit (0);
39 }