1 # Copyright 2023-2024 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/>.
18 require allow_ada_tests
19 require {gnatmake_version_at_least 11}
21 standard_ada_testfile prog
23 if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
27 clean_restart ${testfile}
29 set bp_location [gdb_get_line_number "START" ${testdir}/prog.adb]
30 runto "prog.adb:$bp_location"
33 gdb_test_multiple "ptype Long_Long_Long_Integer" "" {
34 -re -wrap "type = <8-byte integer>" {
36 set max 9223372036854775807
38 -re -wrap "type = <16-byte integer>" {
40 set max 170141183460469231731687303715884105727
44 require {expr $lll_int_size == 8 || $lll_int_size == 16}
46 gdb_test "print x" " = $max"
47 gdb_test "print x / 2" " = [expr $max / 2]"
48 gdb_test "print (x / 4) * 2" " = [expr ($max / 4) * 2]"
49 gdb_test "print x - x" " = 0"
50 gdb_test "print x - 99 + 1" " = [expr $max - 99 + 1]"
51 gdb_test "print -x" " = -$max"
52 gdb_test "print +x" " = $max"
54 gdb_test "print 170141183460469231731687303715884105727" \
55 " = 170141183460469231731687303715884105727"
56 gdb_test "print x = $max" \