]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Test -fgnat-encodings=all in tagged_access.exp
authorTom Tromey <tromey@adacore.com>
Tue, 3 Sep 2024 18:08:43 +0000 (12:08 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 6 Sep 2024 16:31:53 +0000 (10:31 -0600)
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

index 9b4ac6c17866531acbf69441568d78873c7cd28d..57f74409e589798f32359a54e5eb014254a5bac7 100644 (file)
@@ -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"
+}