OLD | NEW |
1 # Copyright 2003, 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 2003, 2007-2012 Free Software Foundation, Inc. |
2 | 2 |
3 # This program is free software; you can redistribute it and/or modify | 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 | 4 # it under the terms of the GNU General Public License as published by |
5 # the Free Software Foundation; either version 3 of the License, or | 5 # the Free Software Foundation; either version 3 of the License, or |
6 # (at your option) any later version. | 6 # (at your option) any later version. |
7 # | 7 # |
8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
12 # | 12 # |
13 # You should have received a copy of the GNU General Public License | 13 # You should have received a copy of the GNU General Public License |
14 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | 15 |
16 # Tests for PR gdb/1355, which is a reference to PR gcc/12066. | 16 # Tests for PR gdb/1355, which is a reference to PR gcc/12066. |
17 # 2003-08-26 Michael Chastain <mec@shout.net> | 17 # 2003-08-26 Michael Chastain <mec@shout.net> |
18 | 18 |
19 # This file is part of the gdb testsuite. | 19 # This file is part of the gdb testsuite. |
20 | 20 |
21 set ws "\[\r\n\t \]*" | 21 set ws "\[\r\n\t \]*" |
22 set nl "\[\r\n\]+" | 22 set nl "\[\r\n\]+" |
23 | 23 |
24 if $tracelevel then { | |
25 strace $tracelevel | |
26 } | |
27 | |
28 if { [skip_cplus_tests] } { continue } | 24 if { [skip_cplus_tests] } { continue } |
29 | 25 |
30 # | 26 # |
31 # test running programs | 27 # test running programs |
32 # | 28 # |
33 | 29 |
34 set testfile "gdb1355" | 30 standard_testfile .cc |
35 set srcfile ${testfile}.cc | |
36 set binfile ${objdir}/${subdir}/${testfile} | |
37 | 31 |
38 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug c++}] != "" } { | 32 if [get_compiler_info "c++"] { |
39 untested gdb1355.exp | |
40 return -1 | |
41 } | |
42 | |
43 if [get_compiler_info ${binfile} "c++"] { | |
44 return -1 | 33 return -1 |
45 } | 34 } |
46 | 35 |
47 gdb_exit | 36 if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} { |
48 gdb_start | 37 return -1 |
49 gdb_reinitialize_dir $srcdir/$subdir | 38 } |
50 gdb_load ${binfile} | |
51 | 39 |
52 if ![runto_main] then { | 40 if ![runto_main] then { |
53 perror "couldn't run to main" | 41 perror "couldn't run to main" |
54 continue | 42 continue |
55 } | 43 } |
56 | 44 |
57 # See http://sources.redhat.com/gdb/bugs/1355 | 45 # See http://sources.redhat.com/gdb/bugs/1355 |
58 # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12066 | 46 # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12066 |
59 # | 47 # |
60 # g++ -gstabs+ does not emit stabs for fundamental types. | 48 # g++ -gstabs+ does not emit stabs for fundamental types. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 -re "$decimal = \{m_int = 117, m_char = 97 'a', m_long_int = 118, m_unsigned
_int = 119, m_long_unsigned_int = 120, m_short_int = 123, m_short_unsigned_int =
124, m_unsigned_char = 98 'b', m_float = 125, m_double = 126, m_long_double = 1
27, m_bool = 117\}$nl$gdb_prompt $" { | 96 -re "$decimal = \{m_int = 117, m_char = 97 'a', m_long_int = 118, m_unsigned
_int = 119, m_long_unsigned_int = 120, m_short_int = 123, m_short_unsigned_int =
124, m_unsigned_char = 98 'b', m_float = 125, m_double = 126, m_long_double = 1
27, m_bool = 117\}$nl$gdb_prompt $" { |
109 # This pattern is very picky, but if more different output | 97 # This pattern is very picky, but if more different output |
110 # shows up, I can just add more arms. -- chastain 2003-08-26 | 98 # shows up, I can just add more arms. -- chastain 2003-08-26 |
111 # | 99 # |
112 # This happened with gcc HEAD 2003-08-20 08:00:00 UTC, -gstabs+. | 100 # This happened with gcc HEAD 2003-08-20 08:00:00 UTC, -gstabs+. |
113 # Look at the value of m_bool. It looks like gdb latched onto | 101 # Look at the value of m_bool. It looks like gdb latched onto |
114 # random int type and then used the data at structure offset 0. | 102 # random int type and then used the data at structure offset 0. |
115 kfail "gdb/1355" "print s1" | 103 kfail "gdb/1355" "print s1" |
116 } | 104 } |
117 } | 105 } |
OLD | NEW |