1 // { dg-require-effective-target nonlocal_goto }
2 // { dg-require-effective-target label_values }
3 /* PR tree-optimization/89280 */
4 
5 int a;
6 void foo (void);
7 __attribute__ ((returns_twice)) int bar (void);
8 void baz (int, int);
9 void *buf[5];
10 
11 static inline void
inl(int x)12 inl (int x)
13 {
14   while (x)
15     foo ();
16 }
17 
18 void
test1(void)19 test1 (void)
20 {
21   for (;;)
22     foo ();
23   baz (bar (), a);
24 }
25 
26 void
test2(void)27 test2 (void)
28 {
29   for (;;)
30     foo ();
31   baz (__builtin_setjmp (buf), a);
32   if (a)
33     __builtin_longjmp (buf, 1);
34 }
35 
36 void
test3(void)37 test3 (void)
38 {
39   inl (1);
40   baz (bar (), a);
41 }
42 
43 void
test4(void)44 test4 (void)
45 {
46   inl (2);
47   baz (__builtin_setjmp (buf), a);
48   if (a)
49     __builtin_longjmp (buf, 1);
50 }
51