diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2017-01-16 08:46:20 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2017-01-16 08:46:20 +0000 |
commit | d743728f903ea03b0114feb594e038ca8ca799d9 (patch) | |
tree | 5ce883331fd401e7bcdea228e3a9ff446c0d5db3 /gcc | |
parent | a2a7ea4834a229da57242c8bc0e14a3fa9fa5a58 (diff) | |
download | gcc-d743728f903ea03b0114feb594e038ca8ca799d9.zip gcc-d743728f903ea03b0114feb594e038ca8ca799d9.tar.gz gcc-d743728f903ea03b0114feb594e038ca8ca799d9.tar.bz2 |
opt62.adb: New test.
* gnat.dg/opt62.adb: New test.
* gnat.dg/opt62_pkg.ads: New helper.
From-SVN: r244485
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/opt62.adb | 15 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/opt62_pkg.ads | 19 |
3 files changed, 39 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 625c99a..7e5731e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-01-16 Eric Botcazou <ebotcazou@adacore.com> + + * gnat.dg/opt62.adb: New test. + * gnat.dg/opt62_pkg.ads: New helper. + 2017-01-14 Bernd Schmidt <bschmidt@redhat.com> PR rtl-optimization/78626 diff --git a/gcc/testsuite/gnat.dg/opt62.adb b/gcc/testsuite/gnat.dg/opt62.adb new file mode 100644 index 0000000..eb7a806 --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt62.adb @@ -0,0 +1,15 @@ +-- { dg-do run } +-- { dg-options "-O" } + +with Opt62_Pkg; use Opt62_Pkg; + +procedure Opt62 is + + String5 : String(1..5) := "12345"; + D: Der := (Unconstrained_Der with D2 => 5, S2 => String5); + +begin + if D.Str1 /= "abcde" then + raise Program_Error; + end if; +end; diff --git a/gcc/testsuite/gnat.dg/opt62_pkg.ads b/gcc/testsuite/gnat.dg/opt62_pkg.ads new file mode 100644 index 0000000..348ee0b --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt62_pkg.ads @@ -0,0 +1,19 @@ +package Opt62_Pkg is + + Default_String : constant String := "This is a default string"; + + subtype Length is Natural range 0..255; + + type Root (D1 : Length) is tagged record + S1 : String(1..D1) := Default_String(1..D1); + end record; + + type Unconstrained_Der is new Root with record + Str1 : String(1..5) := "abcde"; + end record; + + type Der (D2 : Length) is new Unconstrained_Der (D1 => 10) with record + S2 : String(1..D2); + end record; + +end Opt62_Pkg; |