This adds the Ada testcase that detected a since then fixed regression on the 
8 branch introduced by a backport.

Tested on x86_64-suse-linux, applied on mainline, 9 and 8 branches.


2019-05-23  Eric Botcazou  <ebotca...@adacore.com>

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

-- 
Eric Botcazou
-- { 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;
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;

Reply via email to