aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/20040210-1.c
blob: 990cb80756fd493af36efc36c6e1b7db0dc9f732 (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
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-phiopt1-details" } */
 

void abort(void);
void exit(int);

int x, y;

static void __attribute__ ((noinline))
init_xy(void)
{
  x = 3;
  y = 2;
}

void
test4(void)
{
  init_xy();
  if ((x < y ? x++ : y++) != 2)
    abort ();
}

int
main(){
  test4 ();
  exit (0);
}

/* Should have no more than two ifs left after straightening.  */
/* { dg-final { scan-tree-dump-times "if " 2 "phiopt1"} } */
/* { dg-final { cleanup-tree-dump "phiopt1" } } */