From: Eric Botcazou Date: Thu, 23 May 2019 09:48:24 +0000 (+0000) Subject: * gnat.dg/opt78.ad[sb]: New test. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=02b73313044f66774df9b38eadc519d3d7ee7a1b;p=gcc.git * gnat.dg/opt78.ad[sb]: New test. From-SVN: r271545 --- 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;