xref: /netbsd-src/external/gpl3/gdb/dist/gdb/testsuite/gdb.stabs/exclfwd.exp (revision e39ef1d61eee3ccba837ee281f1e098c864487aa)
1#   Copyright 2004, 2007, 2008, 2009, 2010, 2011
2#   Free Software Foundation, Inc.
3
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 3 of the License, or
7# (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17# Please email any bugs, comments, and/or additions to this file to:
18# bug-gdb@gnu.org
19
20if $tracelevel {
21    strace $tracelevel
22}
23
24# If the test directory was not created by configure then skip
25# this test.
26if ![file isdirectory ${objdir}/${subdir}] then {
27    return 0
28}
29
30#
31# test running programs
32#
33
34set testfile exclfwd
35set binfile ${objdir}/${subdir}/${testfile}
36
37foreach file {exclfwd1 exclfwd2} {
38    if {[gdb_compile "${srcdir}/${subdir}/${file}.c" "${file}.o" object {debug}] != ""} {
39        untested exclfwd.exp
40        return -1
41    }
42}
43
44if {[gdb_compile "exclfwd1.o exclfwd2.o" ${binfile} executable {debug}] != "" } {
45     untested exclfwd.exp
46     return -1
47}
48
49gdb_exit
50gdb_start
51gdb_reinitialize_dir $srcdir/$subdir
52gdb_load ${binfile}
53
54if ![runto_main] then {
55    perror "couldn't run to breakpoint"
56    continue
57}
58
59get_debug_format
60
61set eol "\[ \t\]*\[\n\r\]+"
62
63gdb_test "ptype v1" "type = struct a {$eol
64    int x;$eol
65    int y;$eol
66}$eol"
67
68if { [test_debug_format "stabs"] } then {
69    setup_kfail "gdb/1602" *-*-*
70}
71gdb_test "ptype v2" "type = struct a {$eol
72    const char .c;$eol
73}$eol"
74
75if { [test_debug_format "stabs"] } then {
76    setup_kfail "gdb/1603" *-*-*
77}
78gdb_test "ptype v3" "type = const char ."
79