diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c | 23 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/phi-opt-8.c | 2 |
2 files changed, 24 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c new file mode 100644 index 0000000..944acf9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-7.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-O1 -fdump-tree-optimized" } */ + +int g(int,int); +int f(int t, int c) +{ + int d = 0; + int e = 0; + if (t) + { + d = t; + if (c) e = 1; + } + else d = 0, e = 0; + return g(d,e); +} + +/* There should be one ifs as one of them should be changed into + a conditional and the other should be there still. */ +/* { dg-final { scan-tree-dump-times "if" 1 "optimized" } }*/ +/* { dg-final { scan-tree-dump-times "D.\[0-9\]*_\[0-9\]* = c_\[0-9\]*.D. != 0" 1 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ + diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-8.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-8.c index 31dab46..775926d 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-8.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-8.c @@ -19,7 +19,7 @@ int f(int t, int c) but currently is not as PHI-OPT does not reduce the t PHI as we have two phis. Note this is fixed with http://gcc.gnu.org/ml/gcc-patches/2012-01/msg01195.html . */ -/* { dg-final { scan-tree-dump-not "if" "phiopt1" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-not "if" "phiopt1" } } */ /* { dg-final { scan-tree-dump "g .t_\[0-9\]*.D.," "optimized" } } */ /* { dg-final { scan-tree-dump-not "PHI" "optimized" } } */ /* { dg-final { cleanup-tree-dump "phiopt1" } } */ |