Merge from mainline.
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / pr21031.c
blobdf200d564d34dd4e171cd8131bd05a75fc77d172
1 /* PR tree-optimization/21031
3 Make sure that a != 0 is propagated into the "if" statement. */
5 /* { dg-do compile } */
6 /* { dg-options "-O1 -fdump-tree-forwprop1-details" } */
8 int
9 foo (int a)
11 int b = a != 0;
12 unsigned char c = b;
13 if (c)
14 return 1;
15 else
16 return 0;
19 /* { dg-final { scan-tree-dump-times "Replaced" 2 "forwprop1"} } */
20 /* { dg-final { cleanup-tree-dump "forwprop1" } } */