]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Check for compiler support in scalar_storage.exp
authorTom Tromey <tromey@adacore.com>
Wed, 12 Feb 2025 16:35:26 +0000 (09:35 -0700)
committerTom Tromey <tromey@adacore.com>
Tue, 4 Mar 2025 14:42:53 +0000 (07:42 -0700)
gnat-llvm does not currently handle Scalar_Storage_Order.  This patch
changes the scalar_storage.exp test to check the compiler error
messages and report "unsupported" in this case.  This way, the test
ought to start working automatically if this feature is added to
gnat-llvm.

gdb/testsuite/gdb.ada/scalar_storage.exp

index f8fc46974b1a2efca0a8c4d7e20f7f5938022603..47de6e912f78266cb3f04eb00db9650306f60382 100644 (file)
@@ -22,8 +22,20 @@ require allow_ada_tests
 
 standard_ada_testfile storage
 
-if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug ]] != "" } {
-  return -1
+# Compilation here will fail with gnat-llvm, because at the moment it
+# does not support Scalar_Storage_Order.  However, if that is ever
+# implemented, we want the test to start working.  So, we examine the
+# output before deciding if this is a real failure.
+set output [gdb_compile_ada_1 "${srcfile}" "${binfile}" executable debug]
+if {$output != ""} {
+    if {[regexp "error: reverse storage order .* not supported by LLVM" $output]} {
+       unsupported "scalar storage order not supported"
+    } else {
+       # Otherwise issue the fail.
+       gdb_compile_test $srcfile $result
+    }
+    # Either way we're not running this test.
+    return
 }
 
 clean_restart ${testfile}