New gdb.ada/repeat_dyn testcase.
authorJoel Brobecker <brobecker@adacore.com>
Thu, 30 Nov 2017 23:41:55 +0000 (18:41 -0500)
committerJoel Brobecker <brobecker@adacore.com>
Thu, 30 Nov 2017 23:46:45 +0000 (18:46 -0500)
commit875fb7a785e78fddef6da270636e8f4efbfd3e0d
tree966f6bfc65ef3045a4354470c2b983dcd718ea4c
parentfd6798fa2d6f0374d45449c4212869da93623b1e
New gdb.ada/repeat_dyn testcase.

This patch introduces a testcase that exercises a scenario
which used to trigger an internal-error, but no longer does:

Consider the following array:

   type Small is new Integer range Ident (1) .. Ident (10);
   type Table is array (1 .. 3) of Small;
   A1 : Table := (3, 5, 8);

The particularity of this array is that the type of each element
is a range type whose bounds are dynamic, since they depend on
the value returned by Ident (1) and Ident (10). Trying to apply
the repeat operator ('@') on one of its elements used to yield
an internal error:

    (gdb) p a1(1)@3
    $1 =
    /[...]/gdbtypes.c:4512: internal-error:
    copy_type: Assertion `TYPE_OBJFILE_OWNED (type)' failed.

Although the issue no longer appears, the testcase is still
interesting to have.

gdb/testsuite/ChangeLog:

        * gdb.ada/repeat_dyn: New testcase.

Tested on x86_64-linux with clean results.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/repeat_dyn.exp [new file with mode: 0644]
gdb/testsuite/gdb.ada/repeat_dyn/foo_oc22_002.adb [new file with mode: 0644]
gdb/testsuite/gdb.ada/repeat_dyn/pck.adb [new file with mode: 0644]
gdb/testsuite/gdb.ada/repeat_dyn/pck.ads [new file with mode: 0644]