From: Tom Tromey Date: Wed, 12 Feb 2025 17:59:22 +0000 (-0700) Subject: Check whether gnatmake supports -Og X-Git-Tag: binutils-2_45~1397 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e933812402b2e3869d41d50b3518fb80cb57350f;p=thirdparty%2Fbinutils-gdb.git Check whether gnatmake supports -Og gnat-llvm does not support the -Og flag. This arranges to check for this flag before using it. --- diff --git a/gdb/testsuite/gdb.ada/variant_record_field.exp b/gdb/testsuite/gdb.ada/variant_record_field.exp index f3baa25f020..ee7a1f3dbdf 100644 --- a/gdb/testsuite/gdb.ada/variant_record_field.exp +++ b/gdb/testsuite/gdb.ada/variant_record_field.exp @@ -17,6 +17,10 @@ load_lib "ada.exp" require allow_ada_tests +# LLVM does not have -Og, and anyway this is a regression test for a +# GCC bug. +require ada_og + standard_ada_testfile foo # The compiler used to emit an invalid DWARF expression for the record diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp index 0e856f7424d..00ea570fdd7 100644 --- a/gdb/testsuite/lib/ada.exp +++ b/gdb/testsuite/lib/ada.exp @@ -284,3 +284,8 @@ gdb_caching_proc ada_minimal_encodings {} { return [ada_simple_compile minimal_encodings \ additional_flags=-fgnat-encodings=minimal] } + +# Return 1 if GNAT supports -Og. +gdb_caching_proc ada_og {} { + return [ada_simple_compile gnat_og additional_flags=-Og] +}