1# Copyright 2013-2019 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 16load_lib "ada.exp" 17 18standard_ada_testfile foo 19 20set cfile "inc" 21set csrcfile ${srcdir}/${subdir}/${testdir}/${cfile}.c 22set cobject [standard_output_file ${cfile}.o] 23 24gdb_compile "${csrcfile}" "${cobject}" object [list debug] 25if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional_flags=-largs additional_flags=${cobject} additional_flags=-margs]] != "" } { 26 return -1 27} 28 29clean_restart ${testfile} 30 31set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb] 32runto "foo.adb:$bp_location" 33 34gdb_test "ptype m" \ 35 "array \\(1 \\.\\. 1, 2 \\.\\. 3, 4 \\.\\. 6\\) of integer" 36 37gdb_test "print m'first" " = 1" 38gdb_test "print m'last" " = 1" 39gdb_test "print m'length" " = 1" 40 41gdb_test "print m'first(1)" " = 1" 42gdb_test "print m'last(1)" " = 1" 43gdb_test "print m'length(1)" " = 1" 44 45gdb_test "print m'first(2)" " = 2" 46gdb_test "print m'last(2)" " = 3" 47gdb_test "print m'length(2)" " = 2" 48 49gdb_test "print m'first(3)" " = 4" 50gdb_test "print m'last(3)" " = 6" 51gdb_test "print m'length(3)" " = 3" 52 53gdb_test "ptype global_3dim_for_gdb_testing" \ 54 "array \\(0 \\.\\. 0, 0 \\.\\. 1, 0 \\.\\. 2\\) of int" 55 56gdb_test "print global_3dim_for_gdb_testing'first" " = 0" 57gdb_test "print global_3dim_for_gdb_testing'last" " = 0" 58gdb_test "print global_3dim_for_gdb_testing'length" " = 1" 59 60gdb_test "print global_3dim_for_gdb_testing'first(1)" " = 0" 61gdb_test "print global_3dim_for_gdb_testing'last(1)" " = 0" 62gdb_test "print global_3dim_for_gdb_testing'length(1)" " = 1" 63 64gdb_test "print global_3dim_for_gdb_testing'first(2)" " = 0" 65gdb_test "print global_3dim_for_gdb_testing'last(2)" " = 1" 66gdb_test "print global_3dim_for_gdb_testing'length(2)" " = 2" 67 68gdb_test "print global_3dim_for_gdb_testing'first(3)" " = 0" 69gdb_test "print global_3dim_for_gdb_testing'last(3)" " = 2" 70gdb_test "print global_3dim_for_gdb_testing'length(3)" " = 3" 71