aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/torture/pr89135.c
blob: 4cf0533d193cf20f16a33803986fed9fe23444f5 (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
/* { dg-do compile } */
/* { dg-require-effective-target indirect_jumps } */
/* { dg-require-effective-target label_values } */

typedef __INTPTR_TYPE__ intptr_t;
intptr_t a, b, c, d;
int foo (void) { return 0; }
int baz (void);

void
bar (void)
{
  intptr_t g = (intptr_t) &&h;
  void *i = &&j, *k = &&l;
j:
  if (baz ())
    {
      intptr_t **n = (intptr_t **) &a;
l:
      b = 0;
      for (; b >= 0;)
	goto *k;
h:
      **n = 0;
      for (;;)
	{
	  intptr_t *o = &c;
	  g = foo ();
	  *o = g;
	  if (c)
	    goto *(void*)d;
	}
    }
  goto *i;
}