]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.arch/i386-sse-stack-align.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.arch / i386-sse-stack-align.exp
CommitLineData
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 16require is_x86_like_target
f85e18ee
JK
17
18set testfile "i386-sse-stack-align"
19set srcfile ${testfile}.S
20set csrcfile ${testfile}.c
21set executable ${testfile}
3c77faf3 22set binfile [standard_output_file ${executable}]
f85e18ee
JK
23set opts {}
24
25if [info exists COMPILE] {
26 set srcfile ${csrcfile}
27 lappend opts debug optimize=-O2 additional_flags=-msse
28}
29
30if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $opts] != "" } {
84c93cd5 31 unsupported "failed to compile"
f85e18ee
JK
32 return -1
33}
34
35clean_restart $executable
36
75b6f386 37if {![runto_main]} {
f85e18ee
JK
38 return -1
39}
40
41set args ""
42foreach 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}