Debian Codegraph @

gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-4.c

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