aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-43.c
blob: 1d16f283f27bbad024e07555c909bd95dbd0304f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-optimized" } */

/* PR tree-optimization/116890 */

int f(_Bool a, _Bool b, int c)
{
  int x;
  if (c) x = a & b;
  else x = 0;
  return x;
}


/* The if should have been removed as the the conversion from bool to int should have been factored out.  */
/* { dg-final { scan-tree-dump-not "if" "optimized" }  }*/
/* { dg-final { scan-tree-dump-times "\[^\r\n\]*_\[0-9\]* = a_\[0-9\]*.D. & b_\[0-9\]*.D." 1 "optimized"  } } */
/* { dg-final { scan-tree-dump-times "\[^\r\n\]*_\[0-9\]* = c_\[0-9\]*.D. != 0" 1 "optimized"  } } */