Skip to content

Commit

Permalink
Check for compiler support in scalar_storage.exp
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tromey committed Mar 4, 2025
1 parent cf38257 commit be382ec
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions gdb/testsuite/gdb.ada/scalar_storage.exp
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit be382ec

Please sign in to comment.