OSDN Git Service

gcc/testsuite/
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Mar 2007 09:08:04 +0000 (09:08 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Mar 2007 09:08:04 +0000 (09:08 +0000)
* gcc.c-torture/execute/builtins/chk.h (LOCAL): Define.
* gcc.c-torture/execute/builtins/sprintf-chk.c (s1): Make LOCAL.
* gcc.c-torture/execute/builtins/stpcpy-chk.c (s1): Likewise.
* gcc.c-torture/execute/builtins/strcpy-chk.c (s1): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123105 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/builtins/chk.h
gcc/testsuite/gcc.c-torture/execute/builtins/sprintf-chk.c
gcc/testsuite/gcc.c-torture/execute/builtins/stpcpy-chk.c
gcc/testsuite/gcc.c-torture/execute/builtins/strcpy-chk.c

index 147dd30..8be2829 100644 (file)
@@ -1,3 +1,10 @@
+2007-03-21  Richard Sandiford  <richard@codesourcery.com>
+
+       * gcc.c-torture/execute/builtins/chk.h (LOCAL): Define.
+       * gcc.c-torture/execute/builtins/sprintf-chk.c (s1): Make LOCAL.
+       * gcc.c-torture/execute/builtins/stpcpy-chk.c (s1): Likewise.
+       * gcc.c-torture/execute/builtins/strcpy-chk.c (s1): Likewise.
+
 2007-03-19  Seongbae Park <seongbae.park@gmail.com>
 
        PR tree-optimization/30590
index dfef410..625fdef 100644 (file)
@@ -79,3 +79,11 @@ extern volatile int memset_disallowed, strcpy_disallowed, stpcpy_disallowed;
 extern volatile int strncpy_disallowed, strcat_disallowed, strncat_disallowed;
 extern volatile int sprintf_disallowed, vsprintf_disallowed;
 extern volatile int snprintf_disallowed, vsnprintf_disallowed;
+
+/* A storage class that ensures that declarations bind locally.  We want
+   to test non-static declarations where we know it is safe to do so.  */
+#if __PIC__ && !__PIE__
+#define LOCAL static
+#else
+#define LOCAL
+#endif
index 95d2a9d..2862ab6 100644 (file)
@@ -13,7 +13,7 @@ extern int sprintf (char *, const char *, ...);
 
 #include "chk.h"
 
-const char s1[] = "123";
+LOCAL const char s1[] = "123";
 char p[32] = "";
 char *s2 = "defg";
 char *s3 = "FGH";
index b292c0a..6091f12 100644 (file)
@@ -11,7 +11,7 @@ extern int memcmp (const void *, const void *, size_t);
 
 #include "chk.h"
 
-const char s1[] = "123";
+LOCAL const char s1[] = "123";
 char p[32] = "";
 char *s2 = "defg";
 char *s3 = "FGH";
index 002dd19..b3c1a38 100644 (file)
@@ -11,7 +11,7 @@ extern int memcmp (const void *, const void *, size_t);
 
 #include "chk.h"
 
-const char s1[] = "123";
+LOCAL const char s1[] = "123";
 char p[32] = "";
 char *s2 = "defg";
 char *s3 = "FGH";