[gdb/testsuite] Fix FAILs due to PR gcc/101575
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.ada / pkd_arr_elem.exp
index 31f78bddc39ae4506db0a6b6db0c0a15f96e2f97..2d644c60793480880b820d3c3d6b3e49e6a348b0 100644 (file)
@@ -25,8 +25,30 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} {
 
 clean_restart ${testfile}
 
-set bp_location [gdb_get_line_number "START" ${testdir}/failure.adb]
-runto "failure.adb:$bp_location"
+set bp_location \
+    failure.adb:[gdb_get_line_number "START" ${testdir}/failure.adb]
+
+# Workaround gcc PR101575.
+#runto "$bp_location"
+gdb_breakpoint "$bp_location"
+gdb_run_cmd
+set re "Breakpoint $decimal, failure \\(\\) at .*:$decimal.*"
+set re_xfail "Breakpoint $decimal, failure__bounded_funny_stringIP.0 \\(\\) at .*:$decimal.*"
+set ok 1
+gdb_test_multiple "" "Runto to $bp_location" {
+    -re -wrap $re {
+       if { $ok } {
+           pass $gdb_test_name
+       } else {
+           xfail $gdb_test_name
+       }
+    }
+    -re -wrap $re_xfail {
+       set ok 0
+       send_gdb "continue\n"
+       exp_continue
+    }
+}
 
 # Print Test.  The order of the components depends on which version of
 # the compiler being used, as newer version can re-order the order
This page took 0.024621 seconds and 4 git commands to generate.