S390: Restructure s390_push_dummy_call
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.reverse / i387-stack-reverse.exp
CommitLineData
32d0add0 1# Copyright 2009-2015 Free Software Foundation, Inc.
0fa6cf1b
MS
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
16# This file is part of the gdb testsuite.
17
0fa6cf1b
MS
18
19if ![istarget "i?86-*linux*"] then {
20 verbose "Skipping i387 reverse float tests."
21 return
22}
23
7686c074 24standard_testfile
0fa6cf1b
MS
25
26# some targets have leading underscores on assembly symbols.
ee5683ab 27set additional_flags [gdb_target_symbol_prefix_flags]
0fa6cf1b 28
7686c074
TT
29if {[prepare_for_testing $testfile.exp $testfile $srcfile \
30 [list debug $additional_flags]]} {
0fa6cf1b
MS
31 return -1
32}
33
0fa6cf1b
MS
34runto main
35
36# Record to end of main
37
38set location [gdb_get_line_number "END I387-FLOAT-REVERSE"]
bcd2dc50 39gdb_test_no_output "record" "Turn on process record"
a80db015 40gdb_test "until $location" ".*$srcfile:$location.*" \
0fa6cf1b
MS
41 "record to end of main"
42
43# Now rewind to beginning so we can begin testing.
44
45set location [gdb_get_line_number "BEGIN I387-FLOAT-REVERSE"]
bcd2dc50 46gdb_test_no_output "set exec-dir reverse" "set reverse direction"
a80db015 47gdb_test "until $location" ".*$srcfile:$location.*" \
0fa6cf1b 48 "rewind to beginning of main"
bcd2dc50 49gdb_test_no_output "set exec-dir forward" "set forward direction"
0fa6cf1b
MS
50
51# Test FPU stack. FPU stack includes st0, st1, st2, st3, st4,
52# st5, st6, st7. We push 8 values to FPU stack in record mode
53# and see whether all are getting recorded.
54
55set location [gdb_get_line_number "test st0 register"]
a80db015 56gdb_test "until $location" ".*$srcfile:$location.*asm.*fld1.*" \
0fa6cf1b
MS
57 "begin test st0"
58gdb_test "stepi" "asm.*fldl2t.*" "push st0 == 1"
59gdb_test "info register st0" "st0 *1\t.*" "verify st0 == 1"
60
61
62gdb_test "stepi" "asm.*fldl2e.*" "push st0 == 3.3219280948*"
63gdb_test "info register st0" "st0 *3.32192.*\t.*" "verify st0 == 3.321928094*"
64gdb_test "info register st1" "st1 *1\t.*" "verify st1 == 1"
65
66gdb_test "stepi" "asm.*fldpi.*" "push st0 == 1.4426950406*"
67gdb_test "info register st0" "st0 *1.44269.*\t.*" "verify st0 == 1.442695040*"
68gdb_test "info register st1" "st1 *3.32192.*\t.*" "verify st1 == 3.3219280948*"
69gdb_test "info register st2" "st2 *1\t.*" "verify st2 == 1"
70
71gdb_test "stepi" "asm.*fldlg2.*" "push st0 == 3.14159265*"
72gdb_test "info register st0" "st0 *3.14159.*\t.*" "verify st0 == 3.14159265*"
73gdb_test "info register st1" "st1 *1.44269.*\t.*" "verify st1 == 1.4426950*"
74gdb_test "info register st2" "st2 *3.32192.*\t.*" "verify st2 == 3.3219280*"
75gdb_test "info register st3" "st3 *1\t.*" "verify st3 == 1"
76
77gdb_test "stepi" "asm.*fldln2.*" "push st0 == 0.301029*"
78gdb_test "info register st0" "st0 *0.30102.*\t.*" "verify st0 == 0.301029*"
79gdb_test "info register st1" "st1 *3.14159.*\t.*" "verify st1 == 3.14159265*"
80gdb_test "info register st2" "st2 *1.44269.*\t.*" "verify st2 == 1.44269506*"
81gdb_test "info register st3" "st3 *3.32192.*\t.*" "verify st3 == 3.3219280948*"
82gdb_test "info register st4" "st4 *1\t.*" "verify st4 == 1"
83
84gdb_test "stepi" "asm.*fldz.*" "push st0 == 0.69314*"
85gdb_test "info register st0" "st0 *0.69314.*\t.*" "verify st0 == 0.69314*"
86gdb_test "info register st1" "st1 *0.30102.*\t.*" "verify st1 == 0.301029*"
87gdb_test "info register st2" "st2 *3.14159.*\t.*" "verify st2 == 3.14159265*"
88gdb_test "info register st3" "st3 *1.44269.*\t.*" "verify st3 == 1.442695040*"
89gdb_test "info register st4" "st4 *3.32192.*\t.*" "verify st4 == 3.3219280948*"
90gdb_test "info register st5" "st5 *1\t.*" "verify st5 == 1"
91
92gdb_test "stepi" "asm.*fld1.*" "push st0 == 0"
93gdb_test "info register st0" "st0 *0\t.*" "verify st0 == 0"
94gdb_test "info register st1" "st1 *0.69314.*\t.*" "verify st1 == 0.69314*"
95gdb_test "info register st2" "st2 *0.30102.*\t.*" "verify st2 == 0.301029*"
96gdb_test "info register st3" "st3 *3.14159.*\t.*" "verify st3 == 3.14159265*"
97gdb_test "info register st4" "st4 *1.44269.*\t.*" "verify st4 == 1.442695040*"
98gdb_test "info register st5" "st5 *3.32192.*\t.*" "verify st5 == 3.32192809*"
99gdb_test "info register st6" "st6 *1\t.*" "verify st6 == 1"
100
101gdb_test "stepi" "asm.*nop.*" "push st0 == 0"
102gdb_test "info register st0" "st0 *1\t.*" "verify st0 == 1"
103gdb_test "info register st1" "st1 *0\t.*" "verify st1 == 0"
104gdb_test "info register st2" "st2 *0.69314.*\t.*" "verify st2 == 0.69314*"
105gdb_test "info register st3" "st3 *0.30102.*\t.*" "verify st3 == 0.301029*"
106gdb_test "info register st4" "st4 *3.14159.*\t.*" "verify st4 == 3.14159265*"
107gdb_test "info register st5" "st5 *1.44269.*\t.*" "verify st5 == 1.44269504*"
108gdb_test "info register st6" "st6 *3.32192.*\t.*" "verify st6 == 3.3219280948*"
109gdb_test "info register st7" "st7 *1.*" "verify st7 == 1"
110
111# Now step backward, and check that st0 value reverts to zero.
112
113gdb_test "reverse-stepi" "asm.*fld1.*" "undo registers, st0-st7"
114gdb_test "info register st0" "st0 *0\t.*" "verify st0 == 0"
115gdb_test "info register st1" "st1 *0.69314.*\t.*" "verify st1 == 0.69314*"
116gdb_test "info register st2" "st2 *0.30102.*\t.*" "verify st2 == 0.301029*"
117gdb_test "info register st3" "st3 *3.14159.*\t.*" "verify st3 == 3.14159265*"
118gdb_test "info register st4" "st4 *1.44269.*\t.*" "verify st4 == 1.442695040*"
119gdb_test "info register st5" "st5 *3.32192.*\t.*" "verify st5 == 3.3219280948*"
120gdb_test "info register st6" "st6 *1\t.*" "verify st6 == 1"
121
122gdb_test "reverse-stepi" "asm.*fldz.*" "push st0 == 0.69314*"
123gdb_test "info register st0" "st0 *0.69314.*\t.*" "verify st0 == 0.69314*"
124gdb_test "info register st1" "st1 *0.30102.*\t.*" "verify st1 == 0.301029*"
125gdb_test "info register st2" "st2 *3.14159.*\t.*" "verify st2 == 3.14159265*"
126gdb_test "info register st3" "st3 *1.44269.*\t.*" "verify st3 == 1.442695040*"
127gdb_test "info register st4" "st4 *3.32192.*\t.*" "verify st4 == 3.3219280948*"
128gdb_test "info register st5" "st5 *1\t.*" "verify st5 == 1"
129
130gdb_test "reverse-stepi" "asm.*fldln2.*" "push st0 == 0.301029*"
131gdb_test "info register st0" "st0 *0.30102.*\t.*" "verify st0 == 0.301029*"
132gdb_test "info register st1" "st1 *3.14159.*\t.*" "verify st1 == 3.14159265*"
133gdb_test "info register st2" "st2 *1.44269.*\t.*" "verify st2 == 1.442695040*"
134gdb_test "info register st3" "st3 *3.32192.*\t.*" "verify st3 == 3.3219280948*"
135gdb_test "info register st4" "st4 *1\t.*" "verify st4 == 1"
136
137gdb_test "reverse-stepi" "asm.*fldlg2.*" "push st0 == 3.14159265*"
138gdb_test "info register st0" "st0 *3.14159.*\t.*" "verify st0 == 3.14159265*"
139gdb_test "info register st1" "st1 *1.44269.*\t.*" "verify st1 == 1.442695040*"
140gdb_test "info register st2" "st2 *3.32192.*\t.*" "verify st2 == 3.3219280948*"
141gdb_test "info register st3" "st3 *1\t.*" "verify st3 == 1"
142
143gdb_test "reverse-stepi" "asm.*fldpi.*" "push st0 == 1.44269504088*"
144gdb_test "info register st0" "st0 *1.44269.*\t.*" "verify st0 == 1.442695040*"
145gdb_test "info register st1" "st1 *3.32192.*\t.*" "verify st1 == 3.3219280948*"
146gdb_test "info register st2" "st2 *1\t.*" "verify st2 == 1"
147
148
149gdb_test "reverse-stepi" "asm.*fldl2e.*" "push st0 == 3.3219280948*"
150gdb_test "info register st0" "st0 *3.32192.*\t.*" "verify st0 == 3.3219280948*"
151gdb_test "info register st1" "st1 *1\t.*" "verify st1 == 1"
152
153gdb_test "reverse-stepi" "asm.*fldl2t.*" "push st0 == 1"
154gdb_test "info register st0" "st0 *1\t.*" "verify st0 == 1"
155
156
157
158
159
This page took 0.652956 seconds and 4 git commands to generate.