Add gcc.target/i386/pr47364-2.c and gcc.dg/torture/pr47364-1.c.
authorH.J. Lu <hongjiu.lu@intel.com>
Fri, 5 Aug 2011 22:09:56 +0000 (22:09 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Fri, 5 Aug 2011 22:09:56 +0000 (15:09 -0700)
From-SVN: r177488

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr47364-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr47364-2.c [new file with mode: 0644]

index 8f14a9308e684fb3e3fd4da3d0e4994e8b3b7ef0..31eae420ba9fe0be2b55f9780e98597227e42788 100644 (file)
@@ -2,6 +2,8 @@
 
        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>
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr47364-1.c b/gcc/testsuite/gcc.dg/torture/pr47364-1.c
new file mode 100644 (file)
index 0000000..3ac6999
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do run } */
+
+char one[50] = "ijk";
+int
+main (void)
+{
+  return __builtin_strlen (one) != 3;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr47364-2.c b/gcc/testsuite/gcc.target/i386/pr47364-2.c
new file mode 100644 (file)
index 0000000..8c93d6f
--- /dev/null
@@ -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);
+}