summaryrefslogtreecommitdiff
path: root/gcc/testsuite/lib/scanasm.exp
diff options
context:
space:
mode:
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-28 23:38:47 +0000
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-28 23:38:47 +0000
commit1b66ad494b07043860f2c890d7c963ab95004406 (patch)
treef7bb9a830096e0eda4a125d40d0604355b033c4c /gcc/testsuite/lib/scanasm.exp
parent3276c83bdcc633a4dfd9ecb2c5ff19cb0527f6bf (diff)
downloadgcc-1b66ad494b07043860f2c890d7c963ab95004406.tar.gz
2004-10-28 Andrew Pinski <pinskia@physics.uc.edu>
* gcc.dg/visibility-[1-9a].c: Change to use scan-hidden instead of scan-assembler. * lib/scanasm.exp (hidden-scan-for): New proc. (scan-hidden): Use hidden-scan-for instead of constructing the scan string. (scan-not-hidden): Likewise. * lib/target-supports.exp (check_visibility_available): mach-o is support too. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89793 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/lib/scanasm.exp')
-rw-r--r--gcc/testsuite/lib/scanasm.exp24
1 files changed, 22 insertions, 2 deletions
diff --git a/gcc/testsuite/lib/scanasm.exp b/gcc/testsuite/lib/scanasm.exp
index 9116afc1c41..33c574ac34c 100644
--- a/gcc/testsuite/lib/scanasm.exp
+++ b/gcc/testsuite/lib/scanasm.exp
@@ -79,6 +79,21 @@ proc scan-assembler-not { args } {
dg-scan "scan-assembler-not" 0 $testcase $output_file $args
}
+# Return the scan for the assembly for hidden visibility.
+
+proc hidden-scan-for { symbol } {
+
+ set objformat [gcc_target_object_format]
+
+ switch $objformat {
+ elf { return "hidden\[ \t_\]*$symbol" }
+ mach-o { return "private_extern\[ \t_\]*_?$symbol" }
+ default { return "" }
+ }
+
+}
+
+
# Check that a symbol is defined as a hidden symbol in the .s file
# produced by the compiler.
@@ -87,7 +102,10 @@ proc scan-hidden { args } {
set output_file "[file rootname [file tail $testcase]].s"
set symbol [lindex $args 0]
- set args [lreplace $args 0 0 "hidden\[ \t_\]*$symbol"]
+
+ set hidden_scan [hidden-scan-for $symbol]
+
+ set args [lreplace $args 0 0 "$hidden_scan"]
dg-scan "scan-hidden" 1 $testcase $output_file $args
}
@@ -100,7 +118,9 @@ proc scan-not-hidden { args } {
set output_file "[file rootname [file tail $testcase]].s"
set symbol [lindex $args 0]
- set args [lreplace $args 0 0 "hidden\[ \t_\]*$symbol"]
+ set hidden_scan [hidden-scan-for symbol]
+
+ set args [lreplace $args 0 0 "$hidden_scan"]
dg-scan "scan-not-hidden" 0 $testcase $output_file $args
}