From b2fb03eb24256ab8c39516f5f1189e0d50c6f9cd Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Wed, 28 Oct 2015 22:33:46 +0000 Subject: [PATCH] * gnat.dg/discr44.adb: New test. From-SVN: r229508 --- gcc/testsuite/ChangeLog | 8 ++++++-- gcc/testsuite/gnat.dg/discr44.adb | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gnat.dg/discr44.adb diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 711fbb55c2e..43f6007e9e2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,8 @@ -2015-10-26 Jim Wilson +2015-10-28 Eric Botcazou + + * gnat.dg/discr44.adb: New test. + +2015-10-28 Jim Wilson PR debug/66068 * gcc.dg/debug/pr66068.c: New test. @@ -16,7 +20,7 @@ * gcc.target/mips/oddspreg-1.c: Likewise. * gcc.target/mips/oddspreg-2.c: Likewise. -2015-10-05 Senthil Kumar Selvaraj +2015-10-28 Senthil Kumar Selvaraj PR target/67839 * gcc.target/avr/pr67839.c: New test. diff --git a/gcc/testsuite/gnat.dg/discr44.adb b/gcc/testsuite/gnat.dg/discr44.adb new file mode 100644 index 00000000000..ea9f5b139eb --- /dev/null +++ b/gcc/testsuite/gnat.dg/discr44.adb @@ -0,0 +1,27 @@ +-- { dg-do run } +-- { dg-options "-gnatws" } + +procedure Discr44 is + + function Ident (I : Integer) return Integer is + begin + return I; + end; + + type Int is range 1 .. 10; + + type Str is array (Int range <>) of Character; + + type Parent (D1, D2 : Int; B : Boolean) is record + S : Str (D1 .. D2); + end record; + + type Derived (D : Int) is new Parent (D1 => D, D2 => D, B => False); + + X1 : Derived (D => Int (Ident (7))); + +begin + if X1.D /= 7 then + raise Program_Error; + end if; +end; -- 2.30.2