diff options
Diffstat (limited to 'gcc/testsuite/lib/target-supports.exp')
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index f2577c18106..8757dca70e6 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -87,6 +87,12 @@ proc check_weak_available { } { return 1 } + # HP-UX 10.X doesn't support it + + if { [regexp "hppa.*hpux10" $target_triplet] } { + return 0 + } + # ELF and ECOFF support it. a.out does with gas/gld but may also with # other linkers, so we should try it @@ -97,19 +103,22 @@ proc check_weak_available { } { ecoff { return 1 } a.out { return 1 } mach-o { return 1 } + som { return 1 } unknown { return -1 } default { return 0 } } } +# APPLE LOCAL begin mainline 4.0 2005-03-25 ############################### -# proc check_visibility_available { } +# proc check_visibility_available { what_kind } ############################### # The visibility attribute is only support in some object formats # This proc returns 1 if it is supported, 0 if not. +# The argument is the kind of visibility, default/protected/hidden/internal. -proc check_visibility_available { } { +proc check_visibility_available { what_kind } { global visibility_available_saved global tool global target_triplet @@ -119,19 +128,31 @@ proc check_visibility_available { } { 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 + if [string match "" $what_kind] { set what_kind "hidden" } + + if { [info exists visibility_available_saved] } { + verbose "Saved result is <$visibility_available_saved>" 1 + if { [ lsearch -exact $visibility_available_saved $what_kind ] != -1 } { + return 1 + } elseif { [ lsearch -exact $visibility_available_saved "!$what_kind" ] != -1 } { + return 0 } } - return $visibility_available_saved + + set lines [get_compiler_messages visibility object " + void f() __attribute__((visibility(\"$what_kind\"))); + void f() {} + "] + if [string match "" $lines] then { + set answer 1 + lappend visibility_available_saved $what_kind + } else { + set answer 0 + lappend visibility_available_saved "!$what_kind" + } + return $answer } +# APPLE LOCAL end mainline 4.0 2005-03-25 ############################### # proc check_alias_available { } |