diff --git a/gdb/testsuite/gdb.fortran/array-slices-bad.exp b/gdb/testsuite/gdb.fortran/array-slices-bad.exp index 3f8e4434e22..d7b00694539 100644 --- a/gdb/testsuite/gdb.fortran/array-slices-bad.exp +++ b/gdb/testsuite/gdb.fortran/array-slices-bad.exp @@ -28,20 +28,17 @@ if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ # Avoid shared lib symbols. gdb_test_no_output "set auto-solib-add off" -if ![fortran_runto_main] { - return -1 -} - # Avoid libc symbols, in particular the 'array' type. gdb_test_no_output "nosharedlibrary" -# gdb_breakpoint [gdb_get_line_number "Display Message Breakpoint"] -gdb_breakpoint [gdb_get_line_number "First Breakpoint"] +if {![runto [gdb_get_line_number "First Breakpoint"]]} { + perror "couldn't run to breakpoint First Breakpoint" + return -1 +} + gdb_breakpoint [gdb_get_line_number "Second Breakpoint"] gdb_breakpoint [gdb_get_line_number "Final Breakpoint"] -gdb_continue_to_breakpoint "First Breakpoint" - # Access not yet allocated array. gdb_test "print other" " = " gdb_test "print other(0:4,2:3)" "array not allocated" diff --git a/gdb/testsuite/gdb.fortran/vla-type.exp b/gdb/testsuite/gdb.fortran/vla-type.exp index 5a60cdff2f3..a7c9a650c0a 100755 --- a/gdb/testsuite/gdb.fortran/vla-type.exp +++ b/gdb/testsuite/gdb.fortran/vla-type.exp @@ -23,19 +23,14 @@ if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ return -1 } -if ![fortran_runto_main] { - return -1 -} - # Depending on the compiler being used, the type names can be printed differently. set int [fortran_int4] # Check if not allocated VLA in type does not break # the debugger when accessing it. -# break main for Flang compiler already breaks here -if { ![test_compiler_info {flang-*} f90] } { - gdb_breakpoint [gdb_get_line_number "before-allocated"] - gdb_continue_to_breakpoint "before-allocated" +if {![runto [gdb_get_line_number "before-allocated"]]} { + perror "couldn't run to breakpoint before-allocated" + return -1 } gdb_test "print twov" " = \\\( ivla1 = , ivla2 = \\\)" \