From 34520c98a161ccde675d8cf90365eaf653e8c762 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Wed, 28 Mar 2007 23:08:26 +0000 Subject: [PATCH] target-supports.exp (check_effective_target_fstack_protector): New. 2007-03-28 Eric Christopher * lib/target-supports.exp (check_effective_target_fstack_protector): New. * gcc.dg/ssp-1.c: Use. * gcc.dg/ssp-2.c: Ditto. From-SVN: r123314 --- gcc/testsuite/ChangeLog | 24 +++++++++++++++--------- gcc/testsuite/gcc.dg/ssp-1.c | 2 ++ gcc/testsuite/gcc.dg/ssp-2.c | 2 ++ gcc/testsuite/lib/target-supports.exp | 8 ++++++++ 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9b5244e..a869fb6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2007-03-28 Eric Christopher + + * lib/target-supports.exp (check_effective_target_fstack_protector): New. + * gcc.dg/ssp-1.c: Use. + * gcc.dg/ssp-2.c: Ditto. + 2007-03-28 Simon Martin PR c++/29077 @@ -25,7 +31,7 @@ PR c++/29993 * g++.dg/other/cv_func2.C: New. - + 2007-03-27 Janis Johnson * gcc.dg/dfp/func-vararg-alternate.h: New file. @@ -36,7 +42,7 @@ * gcc.dg/dfp/func-vararg-mixed.c: Add optional debugging output. * gcc.dg/dfp/func-vararg-dfp.c: Ditto. - * gcc.dg/dfp/operator-cond.c: Call init, fix typo. + * gcc.dg/dfp/operator-cond.c: Call init, fix typo. * lib/compat.exp (compat-execute): Fix processing of file names. @@ -57,7 +63,7 @@ * g++.dg/warn/pragma-system_header1.C: New test. * g++.dg/warn/pragma-system_header2.C: New test. * g++.dg/warn/pragma-system_header1.h. New. - * g++.dg/warn/pragma-system_header2.h. New. + * g++.dg/warn/pragma-system_header2.h. New. 2007-03-26 Ian Lance Taylor @@ -176,7 +182,7 @@ * gcc.dg/float-range-1.c: Update. Test for a warning. * gcc.dg/float-range-3.c: New. * gcc.dg/float-range-5.c: New. - + 2007-03-22 Francois-Xavier Coudert PR fortran/31262 @@ -300,7 +306,7 @@ * g++.old-deja/g++.eh/cleanup1.C: Likewise. * g++.old-deja/g++.bob/template3.C: Likewise. * g++.old-deja/g++.bob/inherit1.C: Likewise. - + 2007-03-22 Paul Thomas PR fortran/31193 @@ -394,7 +400,7 @@ * gcc.dg/vect/no-tree-dom-vect-bug.c: New test. * gcc.dg/vect/vect.exp: Compile tests with -fno-tree-dominator-opts. - + 2007-03-17 Francois-Xavier Coudert PR fortran/31120 @@ -411,7 +417,7 @@ * g++.dg/warn/Wconversion-real.C: New. * g++.dg/warn/Wconversion-real-integer.C: New. * g++.dg/warn/conv2.C: Updated. - + 2007-03-16 Richard Sandiford * gcc.dg/intmax_t-1.c: Restrict XFAIL to VxWorks kernels; @@ -450,13 +456,13 @@ PR c++/30891 * g++.dg/parse/namespace-definition.C: New. - + 2007-03-15 Manuel Lopez-Ibanez PR c++/24924 * g++.dg/cpp/pedantic-errors.C: New. * g++.dg/cpp/permissive.C: New. - + 2007-03-15 Richard Sandiford * g++.dg/opt/mmx1.C: Only use the PIC options for fpic targets. diff --git a/gcc/testsuite/gcc.dg/ssp-1.c b/gcc/testsuite/gcc.dg/ssp-1.c index c839a5d..e71522b 100644 --- a/gcc/testsuite/gcc.dg/ssp-1.c +++ b/gcc/testsuite/gcc.dg/ssp-1.c @@ -1,5 +1,7 @@ /* { dg-do run { target native } } */ /* { dg-options "-fstack-protector" } */ +/* { dg-require-effective-target fstack_protector } */ + #include static void diff --git a/gcc/testsuite/gcc.dg/ssp-2.c b/gcc/testsuite/gcc.dg/ssp-2.c index 7a5804c..493f3c9 100644 --- a/gcc/testsuite/gcc.dg/ssp-2.c +++ b/gcc/testsuite/gcc.dg/ssp-2.c @@ -1,5 +1,7 @@ /* { dg-do run { target native } } */ /* { dg-options "-fstack-protector" } */ +/* { dg-require-effective-target fstack_protector } */ + #include void diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index f5066d7..47e6ba9 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -491,6 +491,14 @@ proc check_effective_target_fopenmp {} { } "-fopenmp"] } +# Return 1 if the target supports -fstack-protector + +proc check_effective_target_fstack_protector {} { + return [check_no_compiler_messages fstack_protector assembly { + void foo (void) { } + } "-fstack-protector"] +} + # Return 1 if compilation with -freorder-blocks-and-partition is error-free # for trivial code, 0 otherwise. -- 2.7.4