* gnat.dg/opt78.ad[sb]: New test.

From-SVN: r271545
This commit is contained in:
Eric Botcazou 2019-05-23 09:48:24 +00:00 committed by Eric Botcazou
parent 8f5b46e99c
commit 02b7331304
3 changed files with 33 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2019-05-23 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/opt78.ad[sb]: New test.
2019-05-23 Iain Sandoe <iain@sandoe.co.uk>
PR rtl-optimisation/64895

View File

@ -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;

View File

@ -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;