Patchwork Testcase for PR47061

login
register
mail settings
Submitter Richard Guenther
Date June 29, 2012, 2:26 p.m.
Message ID <alpine.LNX.2.00.1206291626290.17233@jbgna.fhfr.qr>
Download mbox | patch
Permalink /patch/168116/
State New
Headers show

Comments

Richard Guenther - June 29, 2012, 2:26 p.m.
Tested on x86_64-unknown-linux-gnu, applied.

Richard.

2012-06-29  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/47061
	* gcc.dg/tree-ssa/vrp71.c: New testcase.

Patch

Index: gcc/testsuite/gcc.dg/tree-ssa/vrp71.c
===================================================================
--- gcc/testsuite/gcc.dg/tree-ssa/vrp71.c	(revision 0)
+++ gcc/testsuite/gcc.dg/tree-ssa/vrp71.c	(working copy)
@@ -0,0 +1,22 @@ 
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-vrp1" } */
+
+int foo(int *p)
+{
+  int x = -10;
+  if (p[0]) x++;
+  if (p[1]) x++;
+  if (p[2]) x++;
+  if (p[3]) x++;
+  x <<= 2;
+  return (x > 0);
+}
+
+int bar(char c)
+{
+  int i = c << 1;
+  return i > 1000;
+}
+
+/* { dg-final { scan-tree-dump-times "return 0;" 2 "vrp1" } } */
+/* { dg-final { cleanup-tree-dump "vrp1" } } */