aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2025-04-14 09:23:30 +0200
committerEric Botcazou <ebotcazou@adacore.com>2025-04-14 09:26:52 +0200
commitec4bf5b6c22e205c9396fc7250da971ec75e3aa3 (patch)
tree457cb65356ec4ba95d85417620a2d80d73dda1bc /gcc
parentd72b4e9f78f841a032538070a035177cc4f20d68 (diff)
downloadgcc-ec4bf5b6c22e205c9396fc7250da971ec75e3aa3.zip
gcc-ec4bf5b6c22e205c9396fc7250da971ec75e3aa3.tar.gz
gcc-ec4bf5b6c22e205c9396fc7250da971ec75e3aa3.tar.bz2
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gnat.dg/lto29.adb9
-rw-r--r--gcc/testsuite/gnat.dg/lto29_pkg.ads15
2 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/lto29.adb b/gcc/testsuite/gnat.dg/lto29.adb
new file mode 100644
index 0000000..44f556f
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/lto29.adb
@@ -0,0 +1,9 @@
+-- { dg-do run }
+-- { dg-options "-O -flto" { target lto } }
+
+with Lto29_Pkg;
+
+procedure Lto29 is
+begin
+ null;
+end;
diff --git a/gcc/testsuite/gnat.dg/lto29_pkg.ads b/gcc/testsuite/gnat.dg/lto29_pkg.ads
new file mode 100644
index 0000000..6008dc5
--- /dev/null
+++ b/gcc/testsuite/gnat.dg/lto29_pkg.ads
@@ -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;