Patchwork [Ping,testsuite] Add -gdwarf to dg-options in debug/dwarf2 testcases

login
register
mail settings
Submitter Senthil Kumar Selvaraj
Date April 18, 2013, 2:54 p.m.
Message ID <20130418145425.GC7656@atmel.com>
Download mbox | patch
Permalink /patch/237670/
State New
Headers show

Comments

Senthil Kumar Selvaraj - April 18, 2013, 2:54 p.m.
On Thu, Apr 18, 2013 at 04:18:31PM +0200, Jakub Jelinek wrote:
> On Thu, Apr 18, 2013 at 07:46:30PM +0530, Senthil Kumar Selvaraj wrote:
> > Ping.
> > 
> > http://gcc.gnu.org/ml/gcc-patches/2013-04/msg00665.html
> 
> Shouldn't dwarf2.exp just prepend that to options instead?

It does it if the testcase doesn't have options of its own.

# If a testcase doesn't have special options, use these.
global DEFAULT_CFLAGS
if ![info exists DEFAULT_CFLAGS] then {
    set DEFAULT_CFLAGS " -ansi -pedantic-errors -gdwarf-2"
}

I see that the gdwarf-2 should be changed to gdwarf. But otherwise,
there are some testcase that pass gdwarf-2 explicitly in dg-options, and I 
wasn't sure if they are intended to be DWARF 2 specific. 

I tried running the test suite with the following patch now.



and it works. Both gdwarf and gdwarf-2 get passed to those tests, and the
latter option wins, so I guess it's ok.

Do you think the above patch would work?

Regards
Senthil

Patch

diff --git gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2.exp gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2.exp
index 829840c..f161787 100644
--- gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2.exp
+++ gcc/testsuite/gcc.dg/debug/dwarf2/dwarf2.exp
@@ -22,7 +22,7 @@  load_lib gcc-dg.exp
 # If a testcase doesn't have special options, use these.
 global DEFAULT_CFLAGS
 if ![info exists DEFAULT_CFLAGS] then {
-    set DEFAULT_CFLAGS " -ansi -pedantic-errors -gdwarf-2"
+    set DEFAULT_CFLAGS " -ansi -pedantic-errors"
 }
 
 # Initialize `dg'.
@@ -31,12 +31,12 @@  dg-init
 # Main loop.
 set comp_output [gcc_target_compile \
     "$srcdir/$subdir/../trivial.c" "trivial.S" assembly \
-    "additional_flags=-gdwarf-2"]
+    "additional_flags=-gdwarf"]
 if { ! [string match "*: target system does not support the * debug format*" \
     $comp_output] } {
     remove-build-file "trivial.S"
     dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\] $srcdir/c-c++-common/dwarf2/*.c]] \
-	    "" $DEFAULT_CFLAGS
+	    " -gdwarf " $DEFAULT_CFLAGS
 }
 
 # All done.