[pushed] Test -fgnat-encodings=all in tagged_access.exp

Message ID 20240906163206.1784578-1-tromey@adacore.com
State New
Headers
Series [pushed] Test -fgnat-encodings=all in tagged_access.exp |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 warning Patch is already merged
linaro-tcwg-bot/tcwg_gdb_build--master-arm warning Patch is already merged

Commit Message

Tom Tromey Sept. 6, 2024, 4:32 p.m. UTC
  While working on a longer series, I needed to make sure this
particular test kept working with -fgnat-encodings=all, so this patch
adds it to the test.
---
 gdb/testsuite/gdb.ada/tagged_access.exp | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)
  

Patch

diff --git a/gdb/testsuite/gdb.ada/tagged_access.exp b/gdb/testsuite/gdb.ada/tagged_access.exp
index 9b4ac6c1786..57f74409e58 100644
--- a/gdb/testsuite/gdb.ada/tagged_access.exp
+++ b/gdb/testsuite/gdb.ada/tagged_access.exp
@@ -21,17 +21,22 @@  require gnat_runtime_has_debug_info
 
 standard_ada_testfile p
 
-if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } {
-  return -1
-}
+foreach_gnat_encoding scenario flags {all minimal} {
+    lappend flags debug
+
+    if {[gdb_compile_ada "${srcfile}" "${binfile}-${scenario}" \
+	     executable $flags] != ""} {
+	return -1
+    }
 
-clean_restart ${testfile}
+    clean_restart ${testfile}-${scenario}
 
-set bp_location [gdb_get_line_number "BREAK" ${testdir}/p.adb]
-runto "p.adb:$bp_location"
+    set bp_location [gdb_get_line_number "BREAK" ${testdir}/p.adb]
+    runto "p.adb:$bp_location"
 
-gdb_test "ptype c.all" \
-         " = new pack\\.interactive_command with record\r\n\\s+menu_name: pack\\.string_access;\r\nend record"
+    gdb_test "ptype c.all" \
+	" = new pack\\.interactive_command with record\r\n\\s+menu_name: pack\\.string_access;\r\nend record"
 
-gdb_test "ptype c.menu_name" \
-         " = access array \\(<>\\) of character"
+    gdb_test "ptype c.menu_name" \
+	" = access array \\(<>\\) of character"
+}