OLD | NEW |
1 # Copyright 2010-2012 Free Software Foundation, Inc. | 1 # Copyright 2010-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 load_lib dwarf.exp | 15 load_lib dwarf.exp |
16 | 16 |
17 # Test DW_OP_GNU_implicit_pointer. | 17 # Test DW_OP_GNU_implicit_pointer. |
18 | 18 |
19 # This test can only be run on targets which support DWARF-2 and use gas. | 19 # This test can only be run on targets which support DWARF-2 and use gas. |
20 if {![dwarf2_support]} { | 20 if {![dwarf2_support]} { |
21 return 0 | 21 return 0 |
22 } | 22 } |
23 | 23 |
24 set testfile "implptr" | 24 standard_testfile .S |
25 set srcfile ${testfile}.S | |
26 set csrcfile ${testfile}.c | 25 set csrcfile ${testfile}.c |
27 set binfile ${objdir}/${subdir}/${testfile}.x | |
28 set opts {} | 26 set opts {} |
29 | 27 |
30 if [info exists COMPILE] { | 28 if [info exists COMPILE] { |
31 # make check RUNTESTFLAGS='gdb.dwarf2/implptr.exp COMPILE=1 CC_FOR_TARGET=gc
c\ -m32' | 29 # make check RUNTESTFLAGS='gdb.dwarf2/implptr.exp COMPILE=1 CC_FOR_TARGET=gc
c\ -m32' |
32 set srcfile ${csrcfile} | 30 set srcfile ${csrcfile} |
33 lappend opts debug optimize=-O2 | 31 lappend opts debug optimize=-O2 |
34 } elseif {![is_x86_like_target]} { | 32 } elseif {![is_x86_like_target]} { |
35 # This test can only be run on x86 targets. | 33 # This test can only be run on x86 targets. |
36 return 0 | 34 return 0 |
37 } | 35 } |
38 | 36 |
39 if {[prepare_for_testing ${testfile}.exp ${testfile}.x $srcfile $opts]} { | 37 if {[prepare_for_testing ${testfile}.exp ${testfile} $srcfile $opts]} { |
40 return -1 | 38 return -1 |
41 } | 39 } |
42 | 40 |
43 # Additional test to verify the referenced CU is not aged out. | 41 # Additional test to verify the referenced CU is not aged out. |
44 gdb_test_no_output "maintenance set dwarf2 max-cache-age 0" | 42 gdb_test_no_output "maintenance set dwarf2 max-cache-age 0" |
45 | 43 |
46 if ![runto_main] { | 44 if ![runto_main] { |
47 return -1 | 45 return -1 |
48 } | 46 } |
49 | 47 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 gdb_test "print *(p\[0].x + 10)" \ | 90 gdb_test "print *(p\[0].x + 10)" \ |
93 "access outside bounds of object referenced via synthetic pointer" \ | 91 "access outside bounds of object referenced via synthetic pointer" \ |
94 "print invalid offset from *p\[0].x in implptr:foo" | 92 "print invalid offset from *p\[0].x in implptr:foo" |
95 gdb_test "print j" " = 69" \ | 93 gdb_test "print j" " = 69" \ |
96 "print j in implptr:foo" | 94 "print j in implptr:foo" |
97 } | 95 } |
98 | 96 |
99 implptr_test_bar | 97 implptr_test_bar |
100 implptr_test_baz | 98 implptr_test_baz |
101 implptr_test_foo | 99 implptr_test_foo |
OLD | NEW |