From bd11046c067c9b3bbae45b2723d7bae0ccc99da2 Mon Sep 17 00:00:00 2001 From: bstarynk Date: Mon, 21 May 2012 10:43:55 +0000 Subject: 2012-05-21 Basile Starynkevitch 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 --- gcc/testsuite/gcc.dg/tree-ssa/vrp67.c | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/vrp67.c (limited to 'gcc/testsuite/gcc.dg/tree-ssa/vrp67.c') 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" } } */ -- cgit v1.2.1