summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr21031.c
blob: a6f5b6e88481335cb48f6d11143434301dfaf311 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* PR tree-optimization/21031

   Make sure that a != 0 is propagated into the "if" statement.  */

/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-forwprop1" } */

int
foo (int a)
{
  int b = a != 0;
  unsigned char c = b;
  if (c)
    return 1;
  else
    return 0;
}

/* { dg-final { scan-tree-dump "if \\(a_\[0-9\]+\\(D\\) != 0\\)" "forwprop1" } } */