]>
Commit | Line | Data |
---|---|---|
1d506c26 | 1 | # Copyright 2012-2024 Free Software Foundation, Inc. |
f85e18ee JK |
2 | # |
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 | |
5 | # the Free Software Foundation; either version 3 of the License, or | |
6 | # (at your option) any later version. | |
7 | # | |
8 | # This program is distributed in the hope that it will be useful, | |
9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | # GNU General Public License for more details. | |
12 | # | |
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/>. | |
15 | ||
18d2b876 | 16 | require is_x86_like_target |
f85e18ee JK |
17 | |
18 | set testfile "i386-sse-stack-align" | |
19 | set srcfile ${testfile}.S | |
20 | set csrcfile ${testfile}.c | |
21 | set executable ${testfile} | |
3c77faf3 | 22 | set binfile [standard_output_file ${executable}] |
f85e18ee JK |
23 | set opts {} |
24 | ||
25 | if [info exists COMPILE] { | |
26 | set srcfile ${csrcfile} | |
27 | lappend opts debug optimize=-O2 additional_flags=-msse | |
28 | } | |
29 | ||
30 | if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $opts] != "" } { | |
84c93cd5 | 31 | unsupported "failed to compile" |
f85e18ee JK |
32 | return -1 |
33 | } | |
34 | ||
35 | clean_restart $executable | |
36 | ||
75b6f386 | 37 | if {![runto_main]} { |
f85e18ee JK |
38 | return -1 |
39 | } | |
40 | ||
41 | set args "" | |
42 | foreach i {0 1 2 3 4} { | |
c47b145e | 43 | set test "print (int) test_g$i ($args)" |
f85e18ee JK |
44 | gdb_test_multiple $test $test { |
45 | -re " = 2\r\n$gdb_prompt $" { | |
46 | pass $test | |
47 | } | |
48 | -re "Program received signal SIGSEGV, Segmentation fault\\..*\r\n$gdb_prompt $" { | |
49 | fail $test | |
50 | } | |
51 | } | |
52 | ||
53 | if {$args != ""} { | |
54 | set args "$args, " | |
55 | } | |
56 | set args "$args[expr $i + 1]" | |
57 | } |