1-- { dg-do compile }
2-- { dg-options "-flto" { target lto } }
3
4procedure Lto2 (Nbytes : Natural) is
5
6   type Message_T (Length : Natural) is record
7      case Length is
8         when 0 => null;
9         when others => Id : Natural;
10      end case;
11   end record;
12
13   type Local_Message_T is new Message_T (Nbytes);
14
15   function One_message return Local_Message_T is
16      M : Local_Message_T;
17   begin
18      if M.Length > 0 then
19         M.Id := 1;
20      end if;
21      return M;
22   end;
23
24   procedure Process (X : Local_Message_T) is begin null; end;
25
26begin
27   Process (One_Message);
28end;
29