diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6f8567c809e..e422d71bdfe 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-05-23 Eric Botcazou + + * gnat.dg/opt78.ad[sb]: New test. + 2019-05-23 Iain Sandoe PR rtl-optimisation/64895 diff --git a/gcc/testsuite/gnat.dg/opt78.adb b/gcc/testsuite/gnat.dg/opt78.adb new file mode 100644 index 00000000000..e46c92b2759 --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt78.adb @@ -0,0 +1,16 @@ +-- { dg-do compile } +-- { dg-options "-O" } + +package body Opt78 is + + procedure Proc (P : UC; Msg : String) is + Default : UC := (1, "!"); + begin + if P = Default then + raise Program_Error; + else + raise Constraint_Error; + end if; + end; + +end Opt78; diff --git a/gcc/testsuite/gnat.dg/opt78.ads b/gcc/testsuite/gnat.dg/opt78.ads new file mode 100644 index 00000000000..2c489bd7b38 --- /dev/null +++ b/gcc/testsuite/gnat.dg/opt78.ads @@ -0,0 +1,13 @@ +package Opt78 is + + subtype Reasonable is Integer range 1..10; + + type UC (D: Reasonable := 2) is record + S: String (1 .. D) := "Hi"; + end record; + + type AUC is access all UC; + + procedure Proc (P : UC; Msg : String); + +end Opt78;