From 9bde221fecaa58b1be8e8288f5ec5c202a61d23f Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Fri, 4 Mar 2022 17:34:18 +0000 Subject: Make gdb.fortran/{array-slices,lbound-ubound} work against gdbserver gdb.fortran/array-slices.exp and gdb.fortran/lbound-ubound.exp were recently disabled unless testing with the native target, because they rely on inferior I/O. However, when testing against gdbserver using the native-gdbserver/native-extended-gdbserver boards, we do have access to inferior I/O. The right way to check whether the board can do I/O, is via checking the gdb,noinferiorio board variable. Switch to using that. And then, tweak the testcases to expect output to appear in inferior_spawn_id, instead of gdb_spawn_id. When testing against the native target, inferior_spawn_id is the same as gdb_spawn_id. When testing against gdbserver, it maps to gdbserver_spawn_id. This exposed a buglet in gdb.fortran/array-slices.f90's show_1d subroutine -- it was missing printing newline at the end of the "Expected GDB Output" text, leading to a test timeout. All other subroutines end with advance=yes, except this one. Fix it by using advance=yes here too. Change-Id: I4640729f334431cfc24b0917e7d3977b677c6ca5 --- gdb/testsuite/gdb.fortran/array-slices.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/testsuite/gdb.fortran/array-slices.f90') diff --git a/gdb/testsuite/gdb.fortran/array-slices.f90 b/gdb/testsuite/gdb.fortran/array-slices.f90 index ff3964f..1eaee82 100644 --- a/gdb/testsuite/gdb.fortran/array-slices.f90 +++ b/gdb/testsuite/gdb.fortran/array-slices.f90 @@ -61,7 +61,7 @@ subroutine show_1d (array) end if write(*, fmt="(I0)", advance="no") array (i) end do - write(*, fmt="(A)", advance="no") ")" + write(*, fmt="(A)", advance="yes") ")" print *, "" ! Display Array Slice 1D end subroutine show_1d -- cgit v1.1