1 # Copyright 2022 Free Software Foundation, Inc.
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.
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.
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/>.
16 # Test floating-point literal extension.
20 if { [skip_ada_tests] } { return -1 }
22 standard_ada_testfile prog
24 if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
28 clean_restart ${testfile}
30 set bp_location [gdb_get_line_number "BREAK" ${testdir}/prog.adb]
31 runto "prog.adb:$bp_location"
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"
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"
46 gdb_test_multiple "ptype long_long_float" "" {
47 -re -wrap "<16-byte float>" {
51 -re -wrap "<\\d+-byte float>" {
56 if { $16llf_supported } {
57 gdb_test "print 16llf#7FFFF7FF4054A56FA5B99019A5C8#" " = 5.0e\\+25"
59 gdb_test "print val_long_double" " = 5.0e\\+25"
60 if { $16llf_supported } {
61 gdb_test "print val_long_double := 16llf#7FFFF7FF4054A56FA5B99019A5C8#" \
64 gdb_test "print val_long_double" " = 5.0e\\+25" \
65 "print val_long_double after assignment"
67 if { $16llf_supported } {
68 gdb_test "print 16llf#a56fa5b99019a5c800007ffff7ff4054#" \
69 " = <invalid float value>"