OSDN Git Service

* fe.h (Serious_Errors_Detected): New macro.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gnat.dg / lto2.adb
1 -- { dg-do compile }
2 -- { dg-options "-flto" { target lto } }
3
4 procedure 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
26 begin
27    Process (One_Message);
28 end;