summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/20030821-1.c
blob: 5de503ed64d78494f152766fe617a049411b7677 (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
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-dom1 -fdump-tree-optimized" } */

void foo(int k)
{
  int i = 1;
  void *label;

  label = k ? &&x : &&y;

  if (k == 1)
    goto *label;

  i = 0;
  goto z;
z:
x:
  if (i)
    dont_remove ();
y: ;
}

/* { dg-final { scan-tree-dump-times "dont_remove \\(\\)" 1 "optimized"} } */

/* We should have folded away the goto &x  */
/* { dg-final { scan-tree-dump-times "goto &x" 0 "optimized"} } */
/* { dg-final { cleanup-tree-dump "optimized" } } */
/* { dg-final { cleanup-tree-dump "dom1" } } */