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