summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/vrp67.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-21 10:43:55 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-21 10:43:55 +0000
commitbd11046c067c9b3bbae45b2723d7bae0ccc99da2 (patch)
tree651676cbef1c8e70dd0202c2989b2ef58678fcd8 /gcc/testsuite/gcc.dg/tree-ssa/vrp67.c
parent0d8c07f78603884b20cb9fd6a07879d382565449 (diff)
downloadgcc-bd11046c067c9b3bbae45b2723d7bae0ccc99da2.tar.gz
2012-05-21 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 187704 using svnmerge git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@187706 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/vrp67.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/vrp67.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp67.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp67.c
new file mode 100644
index 00000000000..f02d83780a6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp67.c
@@ -0,0 +1,38 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+unsigned foo (unsigned i)
+{
+ if (i == 2)
+ {
+ i = i << 2;
+ if (i != 8)
+ link_error ();
+ }
+ return i;
+}
+unsigned bar (unsigned i)
+{
+ if (i == 1 << (sizeof (unsigned) * 8 - 1))
+ {
+ i = i << 1;
+ if (i != 0)
+ link_error ();
+ }
+ return i;
+}
+unsigned baz (unsigned i)
+{
+ i = i & 15;
+ if (i == 0)
+ return 0;
+ i = 1000 - i;
+ i >>= 1;
+ i <<= 1;
+ if (i == 0)
+ link_error ();
+ return i;
+}
+
+/* { dg-final { scan-tree-dump-times "Folding predicate" 3 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */