diff mbox

PATCH: Add a testcase for PR middle-end/47364.

Message ID 20110805221112.GA17845@intel.com
State New
Headers show

Commit Message

H.J. Lu Aug. 5, 2011, 10:11 p.m. UTC
On Fri, Aug 05, 2011 at 03:06:25PM -0700, H.J. Lu wrote:
> Hi,
> 
> I checked in this patch to add a testcase for PR middle-end/47364.
> 

I also checked in 2 other testcases.


H.J.
---
diff mbox

Patch

Index: gcc.target/i386/pr47364-1.c
===================================================================
--- gcc.target/i386/pr47364-1.c	(revision 0)
+++ gcc.target/i386/pr47364-1.c	(revision 177487)
@@ -0,0 +1,12 @@ 
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+static unsigned char foo[256];
+
+arc4_init(void)
+{
+  int n;
+
+  for (n = 0; n < 256; n++)
+    foo[n] = n;
+}
Index: gcc.target/i386/pr47364-2.c
===================================================================
--- gcc.target/i386/pr47364-2.c	(revision 0)
+++ gcc.target/i386/pr47364-2.c	(revision 0)
@@ -0,0 +1,11 @@ 
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+extern __SIZE_TYPE__ strlen (const char *);
+void foo (char *, const char *);
+int bar (const char *prefix)
+{
+    char buff[256];
+    foo (buff, prefix);
+    return strlen(buff);
+}
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 177486)
+++ ChangeLog	(working copy)
@@ -1,3 +1,10 @@ 
+2011-08-05  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR middle-end/47364
+	* gcc.dg/torture/pr47364-1.c: New.
+	* gcc.target/i386/pr47364-1.c: Likewise.
+	* gcc.target/i386/pr47364-2.c: Likewise.
+
 2011-08-05  Thomas Koenig  <tkoenig@gcc.gnu.org>
 
 	PR fortran/37221
Index: gcc.dg/torture/pr47364-1.c
===================================================================
--- gcc.dg/torture/pr47364-1.c	(revision 0)
+++ gcc.dg/torture/pr47364-1.c	(revision 0)
@@ -0,0 +1,8 @@ 
+/* { dg-do run } */
+
+char one[50] = "ijk";
+int
+main (void)
+{
+  return __builtin_strlen (one) != 3;
+}