OSDN Git Service

Index: gcc/ChangeLog
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / debug / debug.exp
1 #   Copyright (C) 2002 Free Software Foundation, Inc.
2
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.
7
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.
12
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.  
16
17 # GCC testsuite that uses the `dg.exp' driver.
18
19 # Load support procs.
20 load_lib gcc-dg.exp
21
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.
25
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*" \
33                 $comp_output] } {
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" ]
39                 }
40             }
41         }
42     }
43 }
44
45 verbose -log "Using options $DEBUG_TORTURE_OPTIONS"
46
47 # Initialize `dg'.
48 dg-init
49
50 # Main loop.
51
52 foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] {
53     global runtests
54
55     # If we're only testing specific files and this isn't one of 
56     # them, skip it.
57     if ![runtest_file_p $runtests $test] {
58         continue
59     }
60
61     set nshort [file tail [file dirname $test]]/[file tail $test]
62
63     foreach flags $DEBUG_TORTURE_OPTIONS {
64         set doit 1
65         if { [string match {*/debug-[126].c} "$nshort"] \
66                 && [string match "*1" [lindex "$flags" 0] ] } { 
67             set doit 0
68         }
69         
70         if { $doit } {
71             verbose -log "Testing $nshort, $flags" 1
72             dg-test $test $flags ""
73         }
74     }
75 }
76
77 # All done.
78 dg-finish