diff options
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/debug/debug.exp | 52 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/debug.exp | 62 | ||||
-rw-r--r-- | gcc/testsuite/lib/gcc-dg.exp | 61 |
4 files changed, 71 insertions, 110 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index abbf2ed0fc8..8ee74fa3fd1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2003-05-17 Mark Mitchell <mark@codesourcery.com> + + * lib/gcc-dg.exp (gcc-dg-debug-runtest): New method. + * g++.dg/debug/debug.exp: Use gcc-dg-debug-runtest. + * gcc.dg/debug/debug.exp: Likewise. + 2003-05-17 Neil Booth <neil@daikokuya.co.uk> * gcc.dg/dollar.c: New test. diff --git a/gcc/testsuite/g++.dg/debug/debug.exp b/gcc/testsuite/g++.dg/debug/debug.exp index 662217951cb..8d6b1e88099 100644 --- a/gcc/testsuite/g++.dg/debug/debug.exp +++ b/gcc/testsuite/g++.dg/debug/debug.exp @@ -19,60 +19,12 @@ # Load support procs. load_lib g++-dg.exp -# This is the list of debugging options we'll try. Some of them won't -# be supported, that's OK; they will be quickly eliminated. -# It's probably not a good idea to add more optimisation options. - -if ![info exists DEBUG_TORTURE_OPTIONS] { - set DEBUG_TORTURE_OPTIONS "" - foreach type {-gdwarf-2 -gstabs -gstabs+ -gxcoff -gxcoff+ -gcoff} { - set comp_output [g++_target_compile \ - "$srcdir/$subdir/trivial.C" "trivial.S" assembly \ - "additional_flags=$type"] - if { ! [string match "*: unknown or unsupported -g option*" \ - $comp_output] } { - foreach level {1 "" 3} { - lappend DEBUG_TORTURE_OPTIONS [list "${type}${level}"] - foreach opt { -O2 -O3 } { - lappend DEBUG_TORTURE_OPTIONS \ - [list "${type}${level}" "$opt" ] - } - } - } - } -} - -verbose -log "Using options $DEBUG_TORTURE_OPTIONS" - # Initialize `dg'. dg-init # Main loop. - -foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.C]] { - global runtests - - # If we're only testing specific files and this isn't one of - # them, skip it. - if ![runtest_file_p $runtests $test] { - continue - } - - set nshort [file tail [file dirname $test]]/[file tail $test] - - foreach flags $DEBUG_TORTURE_OPTIONS { - set doit 1 - # if { [string match {*/debug-[126].c} "$nshort"] \ - # && [string match "*1" [lindex "$flags" 0] ] } { - # set doit 0 - # } - - if { $doit } { - verbose -log "Testing $nshort, $flags" 1 - dg-test $test $flags "" - } - } -} +gcc-dg-debug-runtest g++_target_compile trivial.C \ + [lsort [glob -nocomplain $srcdir/$subdir/*.C]] # All done. dg-finish diff --git a/gcc/testsuite/gcc.dg/debug/debug.exp b/gcc/testsuite/gcc.dg/debug/debug.exp index 3495736c69d..fb83046ead4 100644 --- a/gcc/testsuite/gcc.dg/debug/debug.exp +++ b/gcc/testsuite/gcc.dg/debug/debug.exp @@ -19,71 +19,13 @@ # Load support procs. load_lib gcc-dg.exp -# This is the list of debugging options we'll try. Some of them won't -# be supported, that's OK; they will be quickly eliminated. -# It's probably not a good idea to add more optimisation options. - -if ![info exists DEBUG_TORTURE_OPTIONS] { - set DEBUG_TORTURE_OPTIONS "" - foreach type {-gdwarf-2 -gstabs -gstabs+ -gxcoff -gxcoff+ -gcoff} { - set comp_output [gcc_target_compile \ - "$srcdir/$subdir/trivial.c" "trivial.S" assembly \ - "additional_flags=$type"] - if { ! [string match "*: unknown or unsupported -g option*" \ - $comp_output] } { - foreach level {1 "" 3} { - lappend DEBUG_TORTURE_OPTIONS [list "${type}${level}"] - foreach opt { -O -O3 } { - lappend DEBUG_TORTURE_OPTIONS \ - [list "${type}${level}" "$opt" ] - } - } - } - } -} - -verbose -log "Using options $DEBUG_TORTURE_OPTIONS" - # Initialize `dg'. dg-init # Main loop. -foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] { - global runtests - - # If we're only testing specific files and this isn't one of - # them, skip it. - if ![runtest_file_p $runtests $test] { - continue - } - - set nshort [file tail [file dirname $test]]/[file tail $test] - - foreach flags $DEBUG_TORTURE_OPTIONS { - set doit 1 - if { [string match {*/debug-[126].c} "$nshort"] \ - && [string match "*1" [lindex "$flags" 0] ] } { - set doit 0 - } - -# High optimization can remove the variable whose existence is tested. -# Dwarf debugging with commentary (-dA) preserves the symbol name in the -# assembler output, but stabs debugging does not. -# http://gcc.gnu.org/ml/gcc-regression/2003-04/msg00095.html - if { [string match {*/debug-[12].c} "$nshort"] \ - && [string match "*O3*" "$flags"] \ - && ( [string match "*coff*" "$flags"] \ - || [string match "*stabs*" "$flags"] ) } { - set doit 0 - } - - if { $doit } { - verbose -log "Testing $nshort, $flags" 1 - dg-test $test $flags "" - } - } -} +gcc-dg-debug-runtest gcc_target_compile trivial.c \ + [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] # All done. dg-finish diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp index e0362ad682f..241710c91b1 100644 --- a/gcc/testsuite/lib/gcc-dg.exp +++ b/gcc/testsuite/lib/gcc-dg.exp @@ -189,3 +189,64 @@ proc gcc-dg-runtest { testcases default-extra-flags } { } } } + +proc gcc-dg-debug-runtest { target_compile trivial testcases } { + global srcdir subdir + + if ![info exists DEBUG_TORTURE_OPTIONS] { + set DEBUG_TORTURE_OPTIONS "" + foreach type {-gdwarf-2 -gstabs -gstabs+ -gxcoff -gxcoff+ -gcoff} { + set comp_output [$target_compile \ + "$srcdir/$subdir/$trivial" "trivial.S" assembly \ + "additional_flags=$type"] + if { ! [string match "*: unknown or unsupported -g option*" \ + $comp_output] } { + foreach level {1 "" 3} { + lappend DEBUG_TORTURE_OPTIONS [list "${type}${level}"] + foreach opt { -O2 -O3 } { + lappend DEBUG_TORTURE_OPTIONS \ + [list "${type}${level}" "$opt" ] + } + } + } + } + } + + verbose -log "Using options $DEBUG_TORTURE_OPTIONS" + + global runtests + + foreach test $testcases { + # If we're only testing specific files and this isn't one of + # them, skip it. + if ![runtest_file_p $runtests $test] { + continue + } + + set nshort [file tail [file dirname $test]]/[file tail $test] + + foreach flags $DEBUG_TORTURE_OPTIONS { + set doit 1 + if { [string match {*/debug-[126].c} "$nshort"] \ + && [string match "*1" [lindex "$flags" 0] ] } { + set doit 0 + } + + # High optimization can remove the variable whose existence is tested. + # Dwarf debugging with commentary (-dA) preserves the symbol name in the + # assembler output, but stabs debugging does not. + # http://gcc.gnu.org/ml/gcc-regression/2003-04/msg00095.html + if { [string match {*/debug-[12].c} "$nshort"] \ + && [string match "*O3*" "$flags"] \ + && ( [string match "*coff*" "$flags"] \ + || [string match "*stabs*" "$flags"] ) } { + set doit 0 + } + + if { $doit } { + verbose -log "Testing $nshort, $flags" 1 + dg-test $test $flags "" + } + } + } +} |