summary refs log tree commit diff
path: root/debug/tst-chk1.c
diff options
context:
space:
mode:
Diffstat (limited to 'debug/tst-chk1.c')
-rw-r--r--debug/tst-chk1.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/debug/tst-chk1.c b/debug/tst-chk1.c
index e03f3dba6d..9b69232921 100644
--- a/debug/tst-chk1.c
+++ b/debug/tst-chk1.c
@@ -17,6 +17,9 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+/* Hack: make sure GCC doesn't know __chk_fail () will not return.  */
+#define __noreturn__
+
 #include <assert.h>
 #include <fcntl.h>
 #include <locale.h>
@@ -242,7 +245,7 @@ do_test (void)
   if (memcmp (a.buf1, "aabcdabcjj", 10))
     FAIL ();
 
-#if __USE_FORTIFY_LEVEL < 2
+#if __USE_FORTIFY_LEVEL < 2 || !__GNUC_PREREQ (4, 0)
   /* The following tests are supposed to crash with -D_FORTIFY_SOURCE=2
      and sufficient GCC support, as the string operations overflow
      from a.buf1 into a.buf2.  */
@@ -357,7 +360,7 @@ do_test (void)
   memset (a.buf1 + 9, 'j', l0 + 2);
   CHK_FAIL_END
 
-# if __USE_FORTIFY_LEVEL >= 2
+# if __USE_FORTIFY_LEVEL >= 2 && __GNUC_PREREQ (4, 0)
 #  define O 0
 # else
 #  define O 1