aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/pr89280.c
blob: 15b6e7051f8f0bb1ca58dcc7738a6fc16b1ae828 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// { dg-require-effective-target nonlocal_goto }
// { dg-require-effective-target label_values }
/* PR tree-optimization/89280 */

int a;
void foo (void);
__attribute__ ((returns_twice)) int bar (void);
void baz (int, int);
void *buf[5];

static inline void
inl (int x)
{
  while (x)
    foo ();
}

void
test1 (void)
{
  for (;;)
    foo ();
  baz (bar (), a);
}

void
test2 (void)
{
  for (;;)
    foo ();
  baz (__builtin_setjmp (buf), a);
  if (a)
    __builtin_longjmp (buf, 1);
}

void
test3 (void)
{
  inl (1);
  baz (bar (), a);
}

void
test4 (void)
{
  inl (2);
  baz (__builtin_setjmp (buf), a);
  if (a)
    __builtin_longjmp (buf, 1);
}