summaryrefslogtreecommitdiff
path: root/gcc/testsuite/lib/target-supports.exp
diff options
context:
space:
mode:
authoriains <iains@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-18 08:21:43 +0000
committeriains <iains@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-18 08:21:43 +0000
commit2cda520abcf9bcadf20415fb5566b9030495aa71 (patch)
treef5506f9b52ae792aa93f78dae9d7130acdba793e /gcc/testsuite/lib/target-supports.exp
parentc63903da279b68f96fc544f8bc8305d368b6d358 (diff)
downloadgcc-2cda520abcf9bcadf20415fb5566b9030495aa71.tar.gz
PR debug/42487
* lib/target-supports.exp (check_effective_target_function_sections): New. * gcc.dg/debug/dwarf2/aranges-fnsec-1.c: Check that the target supports function sections before proceding. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163326 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/lib/target-supports.exp')
-rw-r--r--gcc/testsuite/lib/target-supports.exp14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 1f591d85ecc..9cc9b6077b7 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -623,6 +623,20 @@ proc check_effective_target_tls_runtime {} {
}]
}
+# Return 1 if -ffunction-sections is supported, 0 otherwise.
+
+proc check_effective_target_function_sections {} {
+ # Darwin has its own scheme and silently accepts -ffunction-sections.
+ global target_triplet
+ if { [regexp ".*-.*-darwin.*" $target_triplet] } {
+ return 0
+ }
+
+ return [check_no_compiler_messages functionsections assembly {
+ void foo (void) { }
+ } "-ffunction-sections"]
+}
+
# Return 1 if compilation with -fgraphite is error-free for trivial
# code, 0 otherwise.