diff mbox

PR debug/42487, xfail scan-assembler on DW_AT_ranges in gcc.dg/debug/dwarf2/aranges-fnsec-1.c for darwin

Message ID F576194C-5D60-4930-82FF-A795485C57D7@sandoe-acoustics.co.uk
State New
Headers show

Commit Message

Iain Sandoe Aug. 17, 2010, 4:11 p.m. UTC
On 17 Aug 2010, at 16:58, Richard Henderson wrote:

> On 08/17/2010 08:48 AM, Jack Howarth wrote:
>>   Aren't the targets which don't support function sections also
>> those that set TARGET_ASM_FUNCTION_RODATA_SECTION to  
>> default_no_function_rodata_section?
>
> They should be the ones for which targetm.have_named_sections
> is false.  Er, which is now universally true, says grep.  We
> don't support any a.out targets anymore?
>
> I really have no idea, apparently.
>
>> Also, I noticed that we are currently passing some of the other - 
>> function-sections tests
>> on darwin...
>
> Iain explained this one -- .subsections_via_symbols allows many
> of the -function-sections type tests to succeed.  So, I'm really
> not sure how to proceed.  Mark?


like this....?
Iain


Index: gcc/testsuite/gcc.dg/debug/dwarf2/aranges-fnsec-1.c
===================================================================
--- gcc/testsuite/gcc.dg/debug/dwarf2/aranges-fnsec-1.c	(revision  
163308)
+++ gcc/testsuite/gcc.dg/debug/dwarf2/aranges-fnsec-1.c	(working copy)
@@ -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" } } */

Comments

Richard Henderson Aug. 17, 2010, 4:14 p.m. UTC | #1
On 08/17/2010 09:11 AM, IainS wrote:
> like this....?

Looks good to me.


r~
Mark Mitchell Aug. 17, 2010, 6:08 p.m. UTC | #2
IainS wrote:

>> Iain explained this one -- .subsections_via_symbols allows many
>> of the -function-sections type tests to succeed.  So, I'm really
>> not sure how to proceed.  Mark?

Iain's version is fine by me.

If necessary, there must be some way to characterize what's different
about .subsections_via_symbols from ELF -function-sections.
Iain Sandoe Aug. 17, 2010, 7:07 p.m. UTC | #3
On 17 Aug 2010, at 19:08, Mark Mitchell wrote:

> IainS wrote:
>
>>> Iain explained this one -- .subsections_via_symbols allows many
>>> of the -function-sections type tests to succeed.  So, I'm really
>>> not sure how to proceed.  Mark?
>
> Iain's version is fine by me.
>
> If necessary, there must be some way to characterize what's different
> about .subsections_via_symbols from ELF -function-sections.

. subsections_via_symbols  is just an assembler directive - output  
once at the end of the asm - the the linker does the splitting &  
shuffling.
It is output unconditionally for Darwin as things stand (therefore, no  
particular test is needed).

Why the other tests 'work' might take a bit more prodding - since the  
darwin '--gc-sections' is "-Wl,-dead_strip"  - which I don't think is  
enabled by default.

However, at least the patch proposed should get rid of the phantom  
fail we have - and provide a target-requires for future.

Iain
Mike Stump Aug. 17, 2010, 7:45 p.m. UTC | #4
On Aug 17, 2010, at 9:11 AM, IainS wrote:
> like this....?

I'm fine with this as well...
diff mbox

Patch

Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 163308)
+++ gcc/testsuite/lib/target-supports.exp	(working copy)
@@ -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.