OLD | NEW |
1 # Tests for reference types with short type variables in GDB. | 1 # Tests for reference types with short type variables in GDB. |
2 # Copyright 1998-2000, 2004, 2007-2012 Free Software Foundation, Inc. | 2 # Copyright 1998-2000, 2004, 2007-2012 Free Software Foundation, Inc. |
3 | 3 |
4 # This program is free software; you can redistribute it and/or modify | 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 | 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 | 6 # the Free Software Foundation; either version 3 of the License, or |
7 # (at your option) any later version. | 7 # (at your option) any later version. |
8 # | 8 # |
9 # This program is distributed in the hope that it will be useful, | 9 # This program is distributed in the hope that it will be useful, |
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 # GNU General Public License for more details. | 12 # GNU General Public License for more details. |
13 # | 13 # |
14 # You should have received a copy of the GNU General Public License | 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/>. | 15 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 |
17 # written by Elena Zannoni (ezannoni@cygnus.com) | 17 # written by Elena Zannoni (ezannoni@cygnus.com) |
18 | 18 |
19 if $tracelevel then { | |
20 strace $tracelevel | |
21 } | |
22 | |
23 # | 19 # |
24 # test running programs | 20 # test running programs |
25 # | 21 # |
26 | 22 |
27 if { [skip_cplus_tests] } { continue } | 23 if { [skip_cplus_tests] } { continue } |
28 | 24 |
29 set testfile "ref-types" | 25 standard_testfile .cc |
30 set srcfile ${testfile}.cc | |
31 set binfile ${objdir}/${subdir}/${testfile} | |
32 | 26 |
33 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug c++}] != "" } { | 27 if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} { |
34 untested ref-types.exp | 28 return -1 |
35 return -1 | |
36 } | 29 } |
37 | 30 |
38 gdb_exit | |
39 gdb_start | |
40 gdb_reinitialize_dir $srcdir/$subdir | |
41 gdb_load ${binfile} | |
42 | |
43 | |
44 # | 31 # |
45 # set it up at a breakpoint so we can play with the variable values | 32 # set it up at a breakpoint so we can play with the variable values |
46 # | 33 # |
47 if ![runto_main] then { | 34 if ![runto_main] then { |
48 perror "couldn't run to breakpoint" | 35 perror "couldn't run to breakpoint" |
49 continue | 36 continue |
50 } | 37 } |
51 | 38 |
52 if ![runto 'marker1'] then { | 39 if ![runto 'marker1'] then { |
53 perror "couldn't run to marker1" | 40 perror "couldn't run to marker1" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 } | 263 } |
277 | 264 |
278 gdb_test "print rF" \ | 265 gdb_test "print rF" \ |
279 ".\[0-9\]* = \\(float &\\) @$hex: 1.2\[0-9\]*e\\+0?10.*" \ | 266 ".\[0-9\]* = \\(float &\\) @$hex: 1.2\[0-9\]*e\\+0?10.*" \ |
280 "print value of rF" | 267 "print value of rF" |
281 | 268 |
282 gdb_test "print rD" \ | 269 gdb_test "print rD" \ |
283 ".\[0-9\]* = \\(double &\\) @$hex: -1.375e-123.*" \ | 270 ".\[0-9\]* = \\(double &\\) @$hex: -1.375e-123.*" \ |
284 "print value of rD" | 271 "print value of rD" |
285 | 272 |
OLD | NEW |