Debian Codegraph @

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

raw
1 /* { dg-do run } */
2 /* { dg-require-effective-target nonlocal_goto } */
3 /* { dg-require-effective-target trampolines } */
4
5 extern void abort (void);
6
7 int x(int a, int b)
8 {
9 __label__ xlab;
10
11 void y(int b)
12 {
13 switch (b)
14 {
15 case 1: goto xlab;
16 case 2: goto xlab;
17 }
18 }
19
20 a = a + 2;
21 y (b);
22
23 xlab:
24 return a;
25 }
26
27 int main ()
28 {
29 int i, j;
30
31 for (j = 1; j <= 2; ++j)
32 for (i = 1; i <= 2; ++i)
33 {
34 int a = x (j, i);
35 if (a != 2 + j)
36 abort ();
37 }
38
39 return 0;
40 }