aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2004-11-19 19:59:10 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2004-11-19 19:59:10 +0000
commit79c70e5a6ceff0601129c2493a0041e34f4fda5b (patch)
treee69e64e1765d1a9d385782fed992cf589fb4fdf3
parent72c4e4db032ca8db78174fba663b83409e5d4484 (diff)
downloadgcc-79c70e5a6ceff0601129c2493a0041e34f4fda5b.zip
gcc-79c70e5a6ceff0601129c2493a0041e34f4fda5b.tar.gz
gcc-79c70e5a6ceff0601129c2493a0041e34f4fda5b.tar.bz2
target-supports.exp (check_visibility_available): Really test the compiler.
2004-11-19 Mark Mitchell <mark@codesourcery.com> Joseph Myers <joseph@codesourcery.com> * lib/target-supports.exp (check_visibility_available): Really test the compiler. Co-Authored-By: Joseph Myers <joseph@codesourcery.com> From-SVN: r90937
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/lib/target-supports.exp28
2 files changed, 20 insertions, 14 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b08e056..07d05d2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2004-11-19 Mark Mitchell <mark@codesourcery.com>
+ Joseph Myers <joseph@codesourcery.com>
+
+ * lib/target-supports.exp (check_visibility_available): Really
+ test the compiler.
+
2004-11-19 Dorit Naishlos <dorit@il.ibm.com>
PR tree-opt/18181
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index ae85837..e26cd36 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -97,30 +97,30 @@ proc check_weak_available { } {
###############################
# The visibility attribute is only support in some object formats
-# This proc returns 1 if it is supported, 0 if not, -1 if unsure.
+# This proc returns 1 if it is supported, 0 if not.
proc check_visibility_available { } {
+ global visibility_available_saved
+ global tool
global target_triplet
- global target_cpu
# On NetWare, support makes no sense.
-
if { [string match "*-*-netware*" $target_triplet] } {
return 0
}
- # ELF supports it if the system has recent GNU ld and gas.
- # As a start we return 1 for all ELF systems; we'll let people
- # add exceptions as necessary.
-
- set objformat [gcc_target_object_format]
-
- switch $objformat {
- elf { return 1 }
- mach-o { return 1 }
- unknown { return -1 }
- default { return 0 }
+ if {![info exists visibility_available_saved] } {
+ set lines [get_compiler_messages visibility object {
+ void f() __attribute__((visibility("hidden")));
+ void f() {}
+ }]
+ if [string match "" $lines] then {
+ set visibility_available_saved 1
+ } else {
+ set visibility_available_saved 0
+ }
}
+ return $visibility_available_saved
}
###############################