aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gnat.dg/opt85.adb
blob: 94213a458193c6a49b5bdf0aa8229f51352b54b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-- { dg-do compile }
-- { dg-options "-O" }

package body Opt85 is

   function Conversion_Of (Value : Integer) return Data_Type is
   begin
      return (Value => Interfaces.Integer_16 (Value));
   end;

   function Create (Value : Integer) return Record_Type is
      Rec : constant Record_Type :=
        (Ada.Finalization.Controlled with
         Header => (others => False),
         Data   => Conversion_Of (Value));
   begin
      return Rec;
   end;

end Opt85;