From bc65f81fa195167aced2d12a4c8465b5ebc5bcd7 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 5 Aug 2011 22:09:56 +0000 Subject: [PATCH] Add gcc.target/i386/pr47364-2.c and gcc.dg/torture/pr47364-1.c. From-SVN: r177488 --- gcc/testsuite/ChangeLog | 2 ++ gcc/testsuite/gcc.dg/torture/pr47364-1.c | 8 ++++++++ gcc/testsuite/gcc.target/i386/pr47364-2.c | 11 +++++++++++ 3 files changed, 21 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/torture/pr47364-1.c create mode 100644 gcc/testsuite/gcc.target/i386/pr47364-2.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8f14a9308e6..31eae420ba9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 diff --git a/gcc/testsuite/gcc.dg/torture/pr47364-1.c b/gcc/testsuite/gcc.dg/torture/pr47364-1.c new file mode 100644 index 00000000000..3ac6999740f --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr47364-1.c @@ -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 index 00000000000..8c93d6fafb0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr47364-2.c @@ -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); +} -- 2.30.2