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. 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. 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