]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR debug/42487 (FAIL: gcc.dg/debug/dwarf2/aranges-fnsec-1.c scan-assembler DW_AT_r...
authorIain Sandoe <iains@gcc.gnu.org>
Wed, 18 Aug 2010 08:21:43 +0000 (08:21 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Wed, 18 Aug 2010 08:21:43 +0000 (08:21 +0000)
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.

From-SVN: r163326

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

index 60c856d4ec06a577ab2e4df0da78a9d88e047b5a..5b5fb1f5ca6e40764aad6e433043cc8a9632e60f 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 124e28eb7cea050960e017e3bfae0d92efa0625e..8a97e4dc2ac41af1139ffe0155a4e8bc6ea8ca26 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 1f591d85ecce0a05aa48eed6138c87651738dee5..9cc9b6077b7e8a2468da19f91eb594766fcaa69a 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.