OLD | NEW |
1 # Copyright (C) 1998, 2007-2012 Free Software Foundation, Inc. | 1 # Copyright (C) 1998, 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 # optimize.exp -- Expect script for testing apps compiled with -O | 16 # optimize.exp -- Expect script for testing apps compiled with -O |
17 | 17 |
18 # There is no DOC support for gdb yet, return 0 for now. | 18 # There is no DOC support for gdb yet, return 0 for now. |
19 return 0 | 19 return 0 |
20 | 20 |
21 global timeout | 21 global timeout |
22 | 22 |
23 # use this to debug: | 23 # use this to debug: |
24 # | 24 # |
25 #log_user 1 | 25 #log_user 1 |
26 | 26 |
27 if $tracelevel then { | |
28 strace $tracelevel | |
29 } | |
30 | |
31 if { [skip_hp_tests] } then { continue } | 27 if { [skip_hp_tests] } then { continue } |
32 | 28 |
33 set testfile optimize | 29 set testfile optimize |
34 set srcfile ${testfile}.c | 30 set srcfile ${testfile}.c |
35 set binfile ${objdir}/${subdir}/${testfile} | 31 set binfile ${objdir}/${subdir}/${testfile} |
36 | 32 |
37 if [get_compiler_info ${binfile}] { | 33 if [get_compiler_info] { |
38 return -1; | 34 return -1; |
39 } | 35 } |
40 | 36 |
41 | 37 |
42 if { $gcc_compiled } then { continue } | 38 if { $gcc_compiled } then { continue } |
43 | 39 |
44 | 40 |
45 # Vanilla -O, which is the same as +O2 | 41 # Vanilla -O, which is the same as +O2 |
46 # | 42 # |
47 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug optimize=+O2}] != "" } { | 43 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug optimize=+O2}] != "" } { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 gdb_test "x/4i \$pc" ".*main.*main+4.*main+8.*" | 134 gdb_test "x/4i \$pc" ".*main.*main+4.*main+8.*" |
139 gdb_test "c" ".*callee.*" "hit bp" | 135 gdb_test "c" ".*callee.*" "hit bp" |
140 gdb_test "disas" ".*callee.*callee+4.*callee+12.*" | 136 gdb_test "disas" ".*callee.*callee+4.*callee+12.*" |
141 gdb_test "si" ".*callee.*" | 137 gdb_test "si" ".*callee.*" |
142 gdb_test "fin" ".*Run till exit.*main.*" "finish" | 138 gdb_test "fin" ".*Run till exit.*main.*" "finish" |
143 gdb_test "x/i \$pc" ".*main+.*" "back in main" | 139 gdb_test "x/i \$pc" ".*main+.*" "back in main" |
144 gdb_exit | 140 gdb_exit |
145 | 141 |
146 #remote_exec build "rm -f ${binfile}" | 142 #remote_exec build "rm -f ${binfile}" |
147 return 0 | 143 return 0 |
OLD | NEW |