diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/phi-opt-9.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/phi-opt-9.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-9.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-9.c new file mode 100644 index 00000000000..dccea7b0506 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-9.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-optimized" } */ + +int g(int,int); +int f(int t, int c) +{ + int d = 0; + int e = 0; + if (t) + { + d = c+1; + e = t; + } + else d = 0, e = 0; + return g(e,d); +} + +/* The value e should have been replaced with t and there should be only one PHI. */ +/* { dg-final { scan-tree-dump "g .t_\[0-9\]*.D.," "optimized" } } */ +/* { dg-final { scan-tree-dump-times "PHI" 1 "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ |