diff options
author | Jing Yu <jingyu@google.com> | 2009-11-05 15:11:04 -0800 |
---|---|---|
committer | Jing Yu <jingyu@google.com> | 2009-11-05 15:11:04 -0800 |
commit | df62c1c110e8532b995b23540b7e3695729c0779 (patch) | |
tree | dbbd4cbdb50ac38011e058a2533ee4c3168b0205 /gcc-4.4.0/gcc/testsuite/gcc.dg/tree-ssa/vrp47.c | |
parent | 8d401cf711539af5a2f78d12447341d774892618 (diff) | |
download | toolchain_gcc-df62c1c110e8532b995b23540b7e3695729c0779.tar.gz toolchain_gcc-df62c1c110e8532b995b23540b7e3695729c0779.tar.bz2 toolchain_gcc-df62c1c110e8532b995b23540b7e3695729c0779.zip |
Check in gcc sources for prebuilt toolchains in Eclair.
Diffstat (limited to 'gcc-4.4.0/gcc/testsuite/gcc.dg/tree-ssa/vrp47.c')
-rw-r--r-- | gcc-4.4.0/gcc/testsuite/gcc.dg/tree-ssa/vrp47.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/gcc-4.4.0/gcc/testsuite/gcc.dg/tree-ssa/vrp47.c b/gcc-4.4.0/gcc/testsuite/gcc.dg/tree-ssa/vrp47.c new file mode 100644 index 000000000..16548c259 --- /dev/null +++ b/gcc-4.4.0/gcc/testsuite/gcc.dg/tree-ssa/vrp47.c @@ -0,0 +1,46 @@ +/* Skip on MIPS, where LOGICAL_OP_NON_SHORT_CIRCUIT inhibits the setcc + optimizations that expose the VRP opportunity. */ +/* { dg-do compile { target { ! mips*-*-* } } } */ +/* { dg-options "-O2 -fdump-tree-vrp -fdump-tree-dom" } */ + +int h(int x, int y) +{ + if ((x >= 0 && x <= 1) && (y >= 0 && y <= 1)) + return x && y; + else + return -1; +} + +int g(int x, int y) +{ + if ((x >= 0 && x <= 1) && (y >= 0 && y <= 1)) + return x || y; + else + return -1; +} + +int f(int x) +{ + if (x != 0 && x != 1) + return -2; + + else + return !x; +} + +/* Test that x and y are never compared to 0 -- they're always known to be + 0 or 1. */ +/* xfail: PR middle-end/38219 */ +/* { dg-final { scan-tree-dump-times "\[xy\]\[^ \]* !=" 0 "vrp1" { xfail *-*-* }} } */ + +/* This one needs more copy propagation that only happens in dom1. */ +/* xfail: PR middle-end/38219 */ +/* { dg-final { scan-tree-dump-times "x\[^ \]* & y" 1 "dom1" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "x\[^ \]* & y" 1 "vrp1" { xfail *-*-* } } } */ + +/* These two are fully simplified by VRP. */ +/* { dg-final { scan-tree-dump-times "x\[^ \]* \[|\] y" 1 "vrp1" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "x\[^ \]* \\^ 1" 1 "vrp1" { xfail *-*-* } } } */ + +/* { dg-final { cleanup-tree-dump "vrp\[0-9\]" } } */ +/* { dg-final { cleanup-tree-dump "dom\[0-9\]" } } */ |