diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-2.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-2.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-2.c new file mode 100644 index 000000000..dab30addd --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-2.c @@ -0,0 +1,23 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fdump-tree-optimized" } */ + +/* Testcase for PR31657. */ + +int foo (int x, int a, int b) +{ + /* if ((x & a) || (x & b)) */ + if (x & a) + goto doit; + if (x & b) + goto doit; + + /* else */ + return 0; + + /* then - returing 1 causes phiopt to trigger */ +doit: + return 2; +} + +/* { dg-final { scan-tree-dump "\\|" "optimized" } } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ |