summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/vrp19.c
diff options
context:
space:
mode:
authorphython <phython@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-29 15:22:07 +0000
committerphython <phython@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-29 15:22:07 +0000
commit446faf9d7a8a1d1ed8510e5c169b763fb51c7027 (patch)
treed9660d0e09f0dad3cad64576be6dbc0999cb14c1 /gcc/testsuite/gcc.dg/tree-ssa/vrp19.c
parent76bc3d2b3de06ce10583219178f48a0e53143048 (diff)
downloadgcc-446faf9d7a8a1d1ed8510e5c169b763fb51c7027.tar.gz
2005-07-29 James A. Morrison <phython@gcc.gnu.org>
* tree-vrp.c (compare_range_with_value): Return true or false for ~[VAL_1, VAL_2] OP VAL if VAL_1 <= VAL <= VAL_2 for NE_EXPR and EQ_EXPR respectively. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102558 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/vrp19.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/vrp19.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp19.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp19.c
new file mode 100644
index 00000000000..45a85fafe1b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp19.c
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-options "-fwrapv -O1 -ftree-vrp -fdump-tree-vrp" } */
+
+#include <limits.h>
+extern void abort ();
+extern void exit (int);
+
+int f (int a) {
+ if (a != INT_MIN) {
+ a = a > 0 ? a : -a;
+ if (a < 0)
+ return 1;
+ }
+ return 0;
+}
+
+int g (int b) {
+ if (b != INT_MIN) {
+ b = b > 0 ? b : -b;
+ if (b >= 0)
+ return 0;
+ }
+ return 1;
+}
+/* { dg-final { scan-tree-dump "Folding predicate a_. < 0 to 0" "vrp" } } */
+/* { dg-final { scan-tree-dump "Folding predicate b_. >= 0 to 1" "vrp" } } */
+/* { dg-final { cleanup-tree-dump "vrp" } } */