diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp59.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp59.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp59.c b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp59.c new file mode 100644 index 000000000..963282a2a --- /dev/null +++ b/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/vrp59.c @@ -0,0 +1,35 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-tree-ccp -fdump-tree-vrp1" } */ + +int f(int x) +{ + if (x >= 0 && x <= 3) + { + x = x ^ 3; + x = x & 3; + } + return x; +} + +int g(int x) +{ + if (x >= 0 && x <= 3) + { + x = x ^ 2; + x = x & 3; + } + return x; +} + +int h(int x) +{ + if (x >= 0 && x <= 3) + { + x = x ^ 1; + x = x & 3; + } + return x; +} + +/* { dg-final { scan-tree-dump-not " & 3;" "vrp1" } } */ +/* { dg-final { cleanup-tree-dump "vrp1" } } */ |