]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.ada/verylong.exp
Introduce language_defn::lookup_symbol_local
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.ada / verylong.exp
1 # Copyright 2023-2024 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 load_lib "ada.exp"
17
18 require allow_ada_tests
19 require {gnatmake_version_at_least 11}
20
21 standard_ada_testfile prog
22
23 if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
24 return -1
25 }
26
27 clean_restart ${testfile}
28
29 set bp_location [gdb_get_line_number "START" ${testdir}/prog.adb]
30 runto "prog.adb:$bp_location"
31
32 set lll_int_size 0
33 gdb_test_multiple "ptype Long_Long_Long_Integer" "" {
34 -re -wrap "type = <8-byte integer>" {
35 set lll_int_size 8
36 set max 9223372036854775807
37 }
38 -re -wrap "type = <16-byte integer>" {
39 set lll_int_size 16
40 set max 170141183460469231731687303715884105727
41 }
42 }
43
44 require {expr $lll_int_size == 8 || $lll_int_size == 16}
45
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"
53
54 gdb_test "print 170141183460469231731687303715884105727" \
55 " = 170141183460469231731687303715884105727"
56 gdb_test "print x = $max" \
57 " = true"