diff options
author | Eric Christopher <echristo@apple.com> | 2007-04-10 23:00:00 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gcc.gnu.org> | 2007-04-10 23:00:00 +0000 |
commit | 3783f026829b915cfa6f67e3075e72e0cde047a8 (patch) | |
tree | 40208aaac0d485066b49915f7f87bc24794b96ca /gcc | |
parent | 246b8cf5d733bb35c8882015834c07307104e6b5 (diff) | |
download | gcc-3783f026829b915cfa6f67e3075e72e0cde047a8.zip gcc-3783f026829b915cfa6f67e3075e72e0cde047a8.tar.gz gcc-3783f026829b915cfa6f67e3075e72e0cde047a8.tar.bz2 |
2007-04-10 Eric Christopher <echristo@apple.com>
* lib/target-supports.exp
(check_effective_target_fstack_protector): Rewrite.
From-SVN: r123702
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 33 |
2 files changed, 34 insertions, 4 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 037e7a2..f2e261c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-04-10 Eric Christopher <echristo@apple.com> + + * lib/target-supports.exp + (check_effective_target_fstack_protector): Rewrite. + 2007-04-09 Mark Mitchell <mark@codesourcery.com> PR c++/31449 diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 47e6ba9..180686f 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -492,11 +492,36 @@ proc check_effective_target_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"] + global tool + set result "" + + set src stack_prot[pid].c + set exe stack_prot[pid].x + + verbose "check_effective_target_fstack_protector compiling testfile $src" 2 + + set f [open $src "w"] + # Compile a small test program. + puts $f "int main (void)\n { return 0; }\n" + close $f + + set opts "additional_flags=-fstack-protector" + set lines [${tool}_target_compile $src $exe executable "$opts" ] + file delete $src + + if [string match "" $lines] then { + # No error messages, everything is OK. + set result [${tool}_load "./$exe" "" ""] + set status [lindex $result 0] + remote_file build delete $exe + verbose "check_iconv_available status is <$status>" 2 + + if { $status == "pass" } then { + return 1 + } + } + return 0 } # Return 1 if compilation with -freorder-blocks-and-partition is error-free |