diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index e95d9f6afed..a9b81b3301a 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2017-11-30 Joel Brobecker + + * gdb.ada/repeat_dyn: New testcase. + 2017-11-30 Ulrich Weigand * gdb.cell/gcore.exp: Fix typo when setting spu_bin. diff --git a/gdb/testsuite/gdb.ada/repeat_dyn.exp b/gdb/testsuite/gdb.ada/repeat_dyn.exp new file mode 100644 index 00000000000..8f4d42b3ff5 --- /dev/null +++ b/gdb/testsuite/gdb.ada/repeat_dyn.exp @@ -0,0 +1,30 @@ +# Copyright 2016-2017 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +load_lib "ada.exp" + +standard_ada_testfile foo_oc22_002 + +if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } { + return -1 +} + +clean_restart ${testfile} + +set bp_location [gdb_get_line_number "STOP" ${testdir}/foo_oc22_002.adb] +runto "foo_oc22_002.adb:$bp_location" + +gdb_test "print a1(1)@3" \ + " = \\(3, 5, 8\\)" diff --git a/gdb/testsuite/gdb.ada/repeat_dyn/foo_oc22_002.adb b/gdb/testsuite/gdb.ada/repeat_dyn/foo_oc22_002.adb new file mode 100644 index 00000000000..98163c5b429 --- /dev/null +++ b/gdb/testsuite/gdb.ada/repeat_dyn/foo_oc22_002.adb @@ -0,0 +1,25 @@ +-- Copyright 2016-2017 Free Software Foundation, Inc. +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +with Pck; use Pck; + +procedure Foo_OC22_002 is + type Small is new Integer range Ident (1) .. Ident (10); + type Table is array (1 .. 3) of Small; + + A1 : Table := (3, 5, 8); +begin + Do_Nothing (A1'Address); -- STOP +end Foo_OC22_002; diff --git a/gdb/testsuite/gdb.ada/repeat_dyn/pck.adb b/gdb/testsuite/gdb.ada/repeat_dyn/pck.adb new file mode 100644 index 00000000000..f6e5027a758 --- /dev/null +++ b/gdb/testsuite/gdb.ada/repeat_dyn/pck.adb @@ -0,0 +1,27 @@ +-- Copyright 2016-2017 Free Software Foundation, Inc. +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +package body Pck is + function Ident (I : Integer) return Integer + is + begin + return I; + end Ident; + + procedure Do_Nothing (A : System.Address) is + begin + null; + end Do_Nothing; +end Pck; diff --git a/gdb/testsuite/gdb.ada/repeat_dyn/pck.ads b/gdb/testsuite/gdb.ada/repeat_dyn/pck.ads new file mode 100644 index 00000000000..10c885dd314 --- /dev/null +++ b/gdb/testsuite/gdb.ada/repeat_dyn/pck.ads @@ -0,0 +1,22 @@ +-- Copyright 2016-2017 Free Software Foundation, Inc. +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . + +with System; + +package Pck is + function Ident (I : Integer) return Integer; + + procedure Do_Nothing (A : System.Address); +end Pck;