aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/lib/target-supports.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/lib/target-supports.exp')
-rw-r--r--gcc/testsuite/lib/target-supports.exp48
1 files changed, 48 insertions, 0 deletions
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 38d416ccb77..bff0a4f4441 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -63,6 +63,30 @@ proc check_weak_available { } {
}
###############################
+# proc check_visibility_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.
+
+proc check_visibility_available { } {
+ global target_triplet
+ global target_cpu
+
+ # 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 }
+ unknown { return -1 }
+ default { return 0 }
+ }
+}
+
+###############################
# proc check_alias_available { }
###############################
@@ -137,3 +161,27 @@ proc check_gc_sections_available { } {
}
return $gc_sections_available_saved
}
+
+# Return true if profiling is supported on the target.
+
+proc check_profiling_available { } {
+ global profiling_available_saved
+
+ if {![info exists profiling_available_saved]} {
+ # Some targets don't have any implementation of __bb_init_func or are
+ # missing other needed machinery.
+ if { [istarget mmix-*-*]
+ || [istarget arm*-*-elf]
+ || [istarget strongarm*-*-elf]
+ || [istarget xscale*-*-elf]
+ || [istarget cris-*-*]
+ || [istarget h8300-*-*]
+ || [istarget *-*-windiss] } {
+ set profiling_available_saved 0
+ } else {
+ set profiling_available_saved 1
+ }
+ }
+
+ return $profiling_available_saved
+}