Add testcase for PR lto/119792

It demonstrates a serious LTO breakage for the Ada language.

gcc/testsuite/
	PR lto/119792
	* gnat.dg/lto29.adb: New test.
	* gnat.dg/lto29_pkg.ads: New helper.
This commit is contained in:
Eric Botcazou 2025-04-14 09:23:30 +02:00
parent d72b4e9f78
commit ec4bf5b6c2
2 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,9 @@
-- { dg-do run }
-- { dg-options "-O -flto" { target lto } }
with Lto29_Pkg;
procedure Lto29 is
begin
null;
end;

View file

@ -0,0 +1,15 @@
with Ada.Strings.Bounded;
package Lto29_Pkg is
package M is new Ada.Strings.Bounded.Generic_Bounded_Length (10);
type T is new M.Bounded_String;
Null_T : constant T;
private
Null_T : constant T := To_Bounded_String ("");
end Lto29_Pkg;