gcc-dg.exp (gcc-dg-debug-runtest): New method.
* 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. From-SVN: r66918
This commit is contained in:
parent
c08f71aa81
commit
7cbba3092c
4 changed files with 71 additions and 110 deletions
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue