OSDN Git Service

PR debug/42487
authoriains <iains@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 18 Aug 2010 08:21:43 +0000 (08:21 +0000)
committeriains <iains@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 18 Aug 2010 08:21:43 +0000 (08:21 +0000)
* 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

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/debug/dwarf2/aranges-fnsec-1.c
gcc/testsuite/lib/target-supports.exp

index 60c856d..5b5fb1f 100644 (file)
@@ -1,3 +1,11 @@
+2010-08-18  Iain Sandoe  <iains@gcc.gnu.org>
+
+       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.
+       
 2010-08-17  Jakub Jelinek  <jakub@redhat.com>
 
        PR fortran/45308
index 124e28e..8a97e4d 100644 (file)
@@ -2,6 +2,7 @@
    text section if nothing went in there.  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
+/* { dg-require-effective-target function_sections } */
 /* { dg-options "-gdwarf-2 -ffunction-sections -w -dA" } */
 /* { dg-final { scan-assembler-not "\\.Letext0-\\.Ltext0" } } */
 /* { dg-final { scan-assembler-not "\\.Ltext0\[^\n\r\]*Offset 0x0" } } */
index 1f591d8..9cc9b60 100644 (file)
@@ -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.