* [pushed] Disable gdb.ada/dgopt.exp with gnat-llvm
@ 2026-06-26 16:52 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2026-06-26 16:52 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey
gdb.ada/dgopt.exp fails with gnat-llvm.
Looking into it, it turns out that this test case relies on a bug in
GNAT. In particular, despite the use of -gnatDG, GNAT will still put
a reference to "x.adb" into both the DWARF .debug_info and into the
line table. The test relies on this, because the original problem
being fixed here is that, when the test was written, there was a bug
causing these references to be dropped when writing .debug_names.
gnat-llvm does not have this same bug -- it only emits references to
x.adb.dg.
This patch disables this test for gnat-llvm. There's not really a
good way to tell that gnatmake is llvm-based, so while I've added a
new caching proc for this, it is just a proxy for an existing proc.
Since this only affects gnat-llvm, and was discussed internally, I am
going to check it in.
---
gdb/testsuite/gdb.ada/dgopt.exp | 8 ++++++++
gdb/testsuite/lib/ada.exp | 8 ++++++++
2 files changed, 16 insertions(+)
diff --git a/gdb/testsuite/gdb.ada/dgopt.exp b/gdb/testsuite/gdb.ada/dgopt.exp
index 9e8e8a676a8..831aa053f36 100644
--- a/gdb/testsuite/gdb.ada/dgopt.exp
+++ b/gdb/testsuite/gdb.ada/dgopt.exp
@@ -19,6 +19,14 @@ load_lib "ada.exp"
require allow_ada_tests
+# Despite appearances, this is not really an "Ada" test -- instead the
+# scenario here is that GNAT ends up putting one reference to x.adb
+# into the DWARF (whereas it mostly refers to x.adb.dg); and this
+# reference was being incorrectly omitted from .debug_names.
+# gnat-llvm does not have this bug, so the test does not make sense
+# there.
+require !using_gnat_llvm
+
standard_ada_testfile x
if {[gdb_compile_ada "${srcfile}" "${binfile}" executable \
diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp
index 8c9821bb897..e20b35c8ebe 100644
--- a/gdb/testsuite/lib/ada.exp
+++ b/gdb/testsuite/lib/ada.exp
@@ -292,6 +292,14 @@ gdb_caching_proc ada_minimal_encodings {} {
additional_flags=-fgnat-encodings=minimal]
}
+# Return 1 if GNAT is based on LLVM.
+gdb_caching_proc using_gnat_llvm {} {
+ # Whether or not gnatmake will use LLVM can't be determined from
+ # the command line -- e.g., --version doesn't provide any
+ # indication. So for now use a proxy.
+ return [expr {![ada_minimal_encodings]}]
+}
+
# Return 1 if GNAT supports -Og.
gdb_caching_proc ada_og {} {
return [ada_simple_compile gnat_og additional_flags=-Og]
base-commit: 108db853326a1335fadb6d0ad9955dd7714b1ce1
--
2.54.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-26 16:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-26 16:52 [pushed] Disable gdb.ada/dgopt.exp with gnat-llvm Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox