diff options
Diffstat (limited to 'gcc/testsuite/gnat.dg/lto2.adb')
-rw-r--r-- | gcc/testsuite/gnat.dg/lto2.adb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/lto2.adb b/gcc/testsuite/gnat.dg/lto2.adb new file mode 100644 index 000000000..7981097f8 --- /dev/null +++ b/gcc/testsuite/gnat.dg/lto2.adb @@ -0,0 +1,28 @@ +-- { dg-do compile } +-- { dg-options "-flto" { target lto } } + +procedure Lto2 (Nbytes : Natural) is + + type Message_T (Length : Natural) is record + case Length is + when 0 => null; + when others => Id : Natural; + end case; + end record; + + type Local_Message_T is new Message_T (Nbytes); + + function One_message return Local_Message_T is + M : Local_Message_T; + begin + if M.Length > 0 then + M.Id := 1; + end if; + return M; + end; + + procedure Process (X : Local_Message_T) is begin null; end; + +begin + Process (One_Message); +end; |