1 # Copyright (C) 2002 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 # GCC testsuite that uses the `dg.exp' driver.
22 # This is the list of debugging options we'll try. Some of them won't
23 # be supported, that's OK; they will be quickly eliminated.
24 # It's probably not a good idea to add more optimisation options.
26 if ![info exists DEBUG_TORTURE_OPTIONS] {
27 set DEBUG_TORTURE_OPTIONS ""
28 foreach type {-gdwarf-2 -gstabs -gstabs+ -gxcoff -gxcoff+ -gcoff} {
29 set comp_output [gcc_target_compile \
30 "$srcdir/$subdir/trivial.c" "trivial.S" assembly \
31 "additional_flags=$type"]
32 if { ! [string match "*: unknown or unsupported -g option*" \
34 foreach level {1 "" 3} {
35 lappend DEBUG_TORTURE_OPTIONS [list "${type}${level}"]
36 foreach opt { -O -O3 } {
37 lappend DEBUG_TORTURE_OPTIONS \
38 [list "${type}${level}" "$opt" ]
45 verbose -log "Using options $DEBUG_TORTURE_OPTIONS"
52 foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] {
55 # If we're only testing specific files and this isn't one of
57 if ![runtest_file_p $runtests $test] {
61 set nshort [file tail [file dirname $test]]/[file tail $test]
63 foreach flags $DEBUG_TORTURE_OPTIONS {
65 if { [string match {*/debug-[126].c} "$nshort"] \
66 && [string match "*1" [lindex "$flags" 0] ] } {
71 verbose -log "Testing $nshort, $flags" 1
72 dg-test $test $flags ""