Merge from mainline.
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-ccp-11.c
blob4eaad28b177e5869bf0a20a2a6994e72fc28d027
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-tree-optimized" } */
4 /* Test for CPROP across a DAG. */
6 int test111 (int param)
8 int a, b, c;
9 if (param) {
10 a = 3;
11 b = 2;
13 else {
14 a = 2;
15 b = 3;
17 c = a + b;
18 if (c != 5)
19 return 2;
20 return 0;
23 int test1111 (int param)
25 _Bool a, b, c;
26 if (param) {
27 a = 1;
28 b = 0;
30 else {
31 a = 0;
32 b = 1;
34 c = a && b;
35 if (c)
36 return 2;
37 return 0;
40 /* All ifs should be eliminated. */
41 /* { dg-final { scan-tree-dump-times "if " 0 "optimized" } } */
42 /* { dg-final { cleanup-tree-dump "optimized" } } */