OLD | NEW |
1 # Copyright 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 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 # Author: P. N. Hilfinger, AdaCore Inc. | 16 # Author: P. N. Hilfinger, AdaCore Inc. |
17 | 17 |
18 # Note: This test is essentially a transcription of gdb.cp/formatted-ref.exp, | 18 # Note: This test is essentially a transcription of gdb.cp/formatted-ref.exp, |
19 # and is thus much more wordy than it needs to be. There are fewer | 19 # and is thus much more wordy than it needs to be. There are fewer |
20 # tests because only a few parameter types in Ada are required to be | 20 # tests because only a few parameter types in Ada are required to be |
21 # passed by reference, and there is no equivalent of &(&x) for reference | 21 # passed by reference, and there is no equivalent of &(&x) for reference |
22 # values. | 22 # values. |
23 # This also tests that some other arithmetic operations on references | 23 # This also tests that some other arithmetic operations on references |
24 # work properly: condition expression using a reference object as one of its | 24 # work properly: condition expression using a reference object as one of its |
25 # operand. | 25 # operand. |
26 | 26 |
27 if $tracelevel then { | |
28 strace $tracelevel | |
29 } | |
30 | |
31 load_lib "ada.exp" | 27 load_lib "ada.exp" |
32 | 28 |
33 set testdir "formatted_ref" | 29 set testdir "formatted_ref" |
34 set testfile "${testdir}/formatted_ref" | 30 set testfile "${testdir}/formatted_ref" |
35 set srcfile ${srcdir}/${subdir}/${testfile}.adb | 31 set srcfile ${srcdir}/${subdir}/${testfile}.adb |
36 set binfile ${objdir}/${subdir}/${testfile} | 32 set binfile ${objdir}/${subdir}/${testfile} |
37 | 33 |
38 | 34 |
39 file mkdir ${objdir}/${subdir}/${testdir} | 35 file mkdir ${objdir}/${subdir}/${testdir} |
40 if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
{ | 36 if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" }
{ |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 93 |
98 runto defs.adb:[gdb_get_line_number "marker here" ${testdir}/defs.adb ] | 94 runto defs.adb:[gdb_get_line_number "marker here" ${testdir}/defs.adb ] |
99 | 95 |
100 set s1_address [get_address "s1"] | 96 set s1_address [get_address "s1"] |
101 | 97 |
102 test_p_x "s" "(x => 0xd, y => 0x13)" $s1_address | 98 test_p_x "s" "(x => 0xd, y => 0x13)" $s1_address |
103 | 99 |
104 test_p_x_addr "s" $s1_address | 100 test_p_x_addr "s" $s1_address |
105 | 101 |
106 test_p_op1_equals_op2 "s.x" "13" | 102 test_p_op1_equals_op2 "s.x" "13" |
OLD | NEW |