Multilib testing on trunk is currently busted (and surprisingly this
affects any/all targets but it seems nobody cares). We currently get the
following splat:

| ERROR: tcl error code NONE
| ERROR: torture-init: torture_without_loops is not empty as expected

And this takes down pretty much all of testsuite.

|               ========= Summary of gcc testsuite =========
|                            | # of unexpected case / # of unique unexpected 
case
|                            |          gcc |          g++ |     gfortran |
| rv64imafdc/  lp64d/ medlow | 5421 /     4 |    1 /     1 |   72 /    12 |
| rv32imafdc/ ilp32d/ medlow | 5422 /     5 |    3 /     2 |   72 /    12 |
|   rv32imac/  ilp32/ medlow |  391 /     5 |    3 /     2 |  109 /    19 |
|   rv64imac/   lp64/ medlow | 5422 /     5 |    1 /     1 |  109 /    19 |

There have been recent improvements in test harness around pairing of
torture-{init,finish} and checking for leaking torture options. This
however triggers a latent bug introduced way back in 2009: commit 3dd1415dc88
"i386-prefetch.exp: Skip tests when multilib flags contain -march" which
missed a pairing torture-finish. It was benign so far but in the new
regime it causes extra state "torture-init-done" confusing the 2nd round of
tests (in multilib).

This fix moves the early exit outside of torture-{init,finish} bracket
and brings RISC-V testing back to sanity.

| rv64imafdc/  lp64d/ medlow |    3 /     2 |    1 /     1 |   72 /    12 |
| rv32imafdc/ ilp32d/ medlow |    4 /     3 |    3 /     2 |   72 /    12 |
|   rv32imac/  ilp32/ medlow |    3 /     2 |    3 /     2 |  109 /    19 |
|   rv64imac/   lp64/ medlow |    5 /     4 |    1 /     1 |  109 /    19 |

gcc/testsuite:
        * gcc.misc-tests/i386-prefetch.exp: Move early return outside
          the torture-{init,finish}

Signed-off-by: Vineet Gupta <vine...@rivosinc.com>
---
 gcc/testsuite/gcc.misc-tests/i386-prefetch.exp | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/gcc/testsuite/gcc.misc-tests/i386-prefetch.exp 
b/gcc/testsuite/gcc.misc-tests/i386-prefetch.exp
index ad9e56a54bcf..7101b1e30576 100644
--- a/gcc/testsuite/gcc.misc-tests/i386-prefetch.exp
+++ b/gcc/testsuite/gcc.misc-tests/i386-prefetch.exp
@@ -82,6 +82,13 @@ if $tracelevel then {
     strace $tracelevel
 }
 
+if { [board_info target exists multilib_flags]
+     && [string match "* -march=*" " [board_info target multilib_flags] "] } {
+    # Multilib flags come after the -march flags we pass and override
+    # them, so skip these tests when such flags are passed.
+    return
+}
+
 # Load support procs.
 load_lib gcc-dg.exp
 load_lib torture-options.exp
@@ -90,13 +97,6 @@ load_lib torture-options.exp
 dg-init
 torture-init
 
-if { [board_info target exists multilib_flags]
-     && [string match "* -march=*" " [board_info target multilib_flags] "] } {
-    # Multilib flags come after the -march flags we pass and override
-    # them, so skip these tests when such flags are passed.
-    return
-}
-
 set-torture-options $PREFETCH_NONE
 gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/i386-pf-none-*.c]] "" 
""
 
-- 
2.34.1

Reply via email to