From e05de0a910810a34fce108d85f0574a6be53b6e7 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Fri, 22 Jul 2011 08:29:35 +0200 Subject: [PATCH] target-supports.exp (check_ifunc_available): Rewrite. * lib/target-supports.exp (check_ifunc_available): Rewrite. From-SVN: r176616 --- gcc/testsuite/ChangeLog | 4 +++ gcc/testsuite/lib/target-supports.exp | 45 +++++---------------------- 2 files changed, 12 insertions(+), 37 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a63b6474cbb..bae0698f5a5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-07-22 Uros Bizjak + + * lib/target-supports.exp (check_ifunc_available): Rewrite. + 2011-07-21 Sebastian Pop PR middle-end/47654 diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index bec4d6fd762..97e54b2b0ce 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -361,45 +361,16 @@ proc check_alias_available { } { return $alias_available_saved } -############################### -# proc check_ifunc_available { } -############################### - -# Determine if the target toolchain supports the ifunc attribute. - -# Returns 1 if the target supports ifunc. Returns 0 if the target -# does not support ifunc. +# Returns 1 if the target supports ifunc, 0 otherwise. proc check_ifunc_available { } { - global ifunc_available_saved - global tool - - if [info exists ifunc_available_saved] { - verbose "check_ifunc_available returning saved $ifunc_available_saved" 2 - } else { - set src ifunc[pid].c - set obj ifunc[pid].o - verbose "check_ifunc_available compiling testfile $src" 2 - set f [open $src "w"] - puts $f "#endif" - puts $f "#ifdef __cplusplus\nextern \"C\"\n#endif" - puts $f "void g() {}" - puts $f "void f() __attribute__((ifunc(\"g\")));" - close $f - set lines [${tool}_target_compile $src $obj object ""] - file delete $src - remote_file build delete $obj - - if [string match "" $lines] then { - set ifunc_available_saved 1 - } else { - set ifunc_available_saved 0 - } - - verbose "check_ifunc_available returning $ifunc_available_saved" 2 - } - - return $ifunc_available_saved + return [check_no_compiler_messages ifunc_available object { + #ifdef __cplusplus + extern "C" + #endif + void g() {} + void f() __attribute__((ifunc("g"))); + }] } # Returns true if --gc-sections is supported on the target. -- 2.30.2