gdb/testsuite: make gdb.ada/mi_prot.exp stop at expected location
[binutils-gdb.git] / gdb / testsuite / gdb.ada / float-bits.exp
1 # Copyright 2022 Free Software Foundation, Inc.
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 # Test floating-point literal extension.
17
18 load_lib "ada.exp"
19
20 if { [skip_ada_tests] } { return -1 }
21
22 standard_ada_testfile prog
23
24 if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
25 return -1
26 }
27
28 clean_restart ${testfile}
29
30 set bp_location [gdb_get_line_number "BREAK" ${testdir}/prog.adb]
31 runto "prog.adb:$bp_location"
32
33 gdb_test "print 16f#41b80000#" " = 23.0"
34 gdb_test "print val_float" " = 23.0"
35 gdb_test "print val_float := 16f#41b80000#" " = 23.0"
36 gdb_test "print val_float" " = 23.0" \
37 "print val_float after assignment"
38
39 gdb_test "print 16lf#bc0d83c94fb6d2ac#" " = -2.0e-19"
40 gdb_test "print val_double" " = -2.0e-19"
41 gdb_test "print val_double := 16lf#bc0d83c94fb6d2ac#" " = -2.0e-19"
42 gdb_test "print val_double" " = -2.0e-19" \
43 "print val_double after assignment"
44
45 set 16llf_supported 0
46 gdb_test_multiple "ptype long_long_float" "" {
47 -re -wrap "<16-byte float>" {
48 set 16llf_supported 1
49 pass $gdb_test_name
50 }
51 -re -wrap "<\\d+-byte float>" {
52 pass $gdb_test_name
53 }
54 }
55
56 if { $16llf_supported } {
57 gdb_test "print 16llf#7FFFF7FF4054A56FA5B99019A5C8#" " = 5.0e\\+25"
58 }
59 gdb_test "print val_long_double" " = 5.0e\\+25"
60 if { $16llf_supported } {
61 gdb_test "print val_long_double := 16llf#7FFFF7FF4054A56FA5B99019A5C8#" \
62 " = 5.0e\\+25"
63 }
64 gdb_test "print val_long_double" " = 5.0e\\+25" \
65 "print val_long_double after assignment"
66
67 if { $16llf_supported } {
68 gdb_test "print 16llf#a56fa5b99019a5c800007ffff7ff4054#" \
69 " = <invalid float value>"
70 }