public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sim: sh: simplify testsuite a bit
@ 2021-11-09  6:27 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2021-11-09  6:27 UTC (permalink / raw)
  To: gdb-patches

Switch from the centralized list in the exp file to each test declaring
its own requirements which they're already (mostly) doing.  This will
increase coverage slightly by running more tests in more configurations
since the hardcoded exp list was a little out of date.

We have to mark the psh* tests as shdsp only (to match what the exp
file was doing), mark the fsca & fsrra tests as failing (since they
weren't even being run by the exp file), and to fix the expected
output & status of the fail test.
---
 sim/testsuite/sh/allinsn.exp | 78 ++----------------------------------
 sim/testsuite/sh/fail.s      |  2 +
 sim/testsuite/sh/fsca.s      |  1 +
 sim/testsuite/sh/fsrra.s     |  1 +
 sim/testsuite/sh/pshai.s     |  3 +-
 sim/testsuite/sh/pshar.s     |  3 +-
 sim/testsuite/sh/pshli.s     |  3 +-
 sim/testsuite/sh/pshlr.s     |  3 +-
 8 files changed, 12 insertions(+), 82 deletions(-)

diff --git a/sim/testsuite/sh/allinsn.exp b/sim/testsuite/sh/allinsn.exp
index 40d139299426..ef2c59f23013 100644
--- a/sim/testsuite/sh/allinsn.exp
+++ b/sim/testsuite/sh/allinsn.exp
@@ -1,6 +1,6 @@
 # sh tests
 
-set all "sh shdsp"
+set all_machs "sh shdsp"
 
 set global_as_options ""
 set global_ld_options ""
@@ -13,77 +13,7 @@ foreach opt $board_variant_list {
 }
 
 if [istarget sh-*elf] {
-    run_sim_test add.s    $all
-    run_sim_test and.s    $all
-    run_sim_test bandor.s sh
-    run_sim_test bandornot.s sh
-    run_sim_test bclr.s   sh
-    run_sim_test bld.s    sh
-    run_sim_test bldnot.s sh
-    run_sim_test bset.s   sh
-    run_sim_test bst.s    sh
-    run_sim_test bxor.s   sh
-    run_sim_test clip.s   sh
-    run_sim_test div.s    sh
-    run_sim_test dmxy.s   shdsp
-    run_sim_test fabs.s   sh
-    run_sim_test fadd.s   sh
-    run_sim_test fcmpeq.s sh
-    run_sim_test fcmpgt.s sh
-    run_sim_test fcnvds.s sh
-    run_sim_test fcnvsd.s sh
-    run_sim_test fdiv.s   sh
-    run_sim_test fipr.s   sh
-    run_sim_test fldi0.s  sh
-    run_sim_test fldi1.s  sh
-    run_sim_test flds.s   sh
-    run_sim_test float.s  sh
-    run_sim_test fmac.s   sh
-    run_sim_test fmov.s   sh
-    run_sim_test fmul.s   sh
-    run_sim_test fneg.s   sh
-    run_sim_test fpchg.s  sh
-    run_sim_test frchg.s  sh
-    run_sim_test fschg.s  sh
-    run_sim_test fsqrt.s  sh
-    run_sim_test fsub.s   sh
-    run_sim_test ftrc.s   sh
-    run_sim_test ldrc.s   shdsp
-    run_sim_test loop.s   shdsp
-    run_sim_test macl.s   sh
-    run_sim_test macw.s   sh
-    run_sim_test mov.s    $all
-    run_sim_test movi.s   $all
-    run_sim_test movli.s  $all
-    run_sim_test movua.s  $all
-    run_sim_test movxy.s  shdsp
-    run_sim_test mulr.s   sh
-    run_sim_test pabs.s   shdsp
-    run_sim_test paddc.s  shdsp
-    run_sim_test padd.s   shdsp
-    run_sim_test pand.s   shdsp
-    run_sim_test pclr.s   shdsp
-    run_sim_test pdec.s   shdsp
-    run_sim_test pdmsb.s  shdsp
-    run_sim_test pinc.s   shdsp
-    run_sim_test pmuls.s  shdsp
-    run_sim_test prnd.s   shdsp
-    run_sim_test pshai.s  shdsp
-    run_sim_test pshar.s  shdsp
-    run_sim_test pshli.s  shdsp
-    run_sim_test pshlr.s  shdsp
-    run_sim_test psub.s   shdsp
-    run_sim_test pswap.s  shdsp
-    run_sim_test pushpop.s sh
-    run_sim_test resbank.s sh
-    run_sim_test sett.s   sh
-    run_sim_test shll.s   $all
-    run_sim_test shll2.s  $all
-    run_sim_test shll8.s  $all
-    run_sim_test shll16.s $all
-    run_sim_test shlr.s   $all
-    run_sim_test shlr2.s  $all
-    run_sim_test shlr8.s  $all
-    run_sim_test shlr16.s $all
-    run_sim_test swap.s   $all
+    foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.s]] {
+	run_sim_test $src $all_machs
+    }
 }
diff --git a/sim/testsuite/sh/fail.s b/sim/testsuite/sh/fail.s
index 0ffb0b2a6ff5..f8b180455962 100644
--- a/sim/testsuite/sh/fail.s
+++ b/sim/testsuite/sh/fail.s
@@ -2,6 +2,8 @@
 # mach:	 all
 # as(sh):	-defsym sim_cpu=0
 # as(shdsp):	-defsym sim_cpu=1 -dsp 
+# output: fail\n
+# status: 1
 
 	.include "testutils.inc"
 
diff --git a/sim/testsuite/sh/fsca.s b/sim/testsuite/sh/fsca.s
index 90df6c976800..6eb5824b28e6 100644
--- a/sim/testsuite/sh/fsca.s
+++ b/sim/testsuite/sh/fsca.s
@@ -1,6 +1,7 @@
 # sh testcase for fsca
 # mach: sh
 # as(sh):	-defsym sim_cpu=0
+# xerror: test hasn't been run in a long time
 
 	.include "testutils.inc"
 
diff --git a/sim/testsuite/sh/fsrra.s b/sim/testsuite/sh/fsrra.s
index fdd22356d667..14d41e0d06dc 100644
--- a/sim/testsuite/sh/fsrra.s
+++ b/sim/testsuite/sh/fsrra.s
@@ -1,6 +1,7 @@
 # sh testcase for fsrra
 # mach: sh
 # as(sh):	-defsym sim_cpu=0
+# xerror: test hasn't been run in a long time
 
 	.include "testutils.inc"
 
diff --git a/sim/testsuite/sh/pshai.s b/sim/testsuite/sh/pshai.s
index b2cdbbc81b8c..cbc3573141e8 100644
--- a/sim/testsuite/sh/pshai.s
+++ b/sim/testsuite/sh/pshai.s
@@ -1,6 +1,5 @@
 # sh testcase for psha <imm>
-# mach: all
-# as(sh):	-defsym sim_cpu=0
+# mach: shdsp
 # as(shdsp):	-defsym sim_cpu=1 -dsp 
 
 	.include "testutils.inc"
diff --git a/sim/testsuite/sh/pshar.s b/sim/testsuite/sh/pshar.s
index 01c4b5fdef26..0066819cfd66 100644
--- a/sim/testsuite/sh/pshar.s
+++ b/sim/testsuite/sh/pshar.s
@@ -1,6 +1,5 @@
 # sh testcase for psha <reg>
-# mach: all
-# as(sh):	-defsym sim_cpu=0
+# mach: shdsp
 # as(shdsp):	-defsym sim_cpu=1 -dsp 
 
 	.include "testutils.inc"
diff --git a/sim/testsuite/sh/pshli.s b/sim/testsuite/sh/pshli.s
index a6616e896ac7..73adf2673fd2 100644
--- a/sim/testsuite/sh/pshli.s
+++ b/sim/testsuite/sh/pshli.s
@@ -1,6 +1,5 @@
 # sh testcase for pshl <imm>
-# mach: all
-# as(sh):	-defsym sim_cpu=0
+# mach: shdsp
 # as(shdsp):	-defsym sim_cpu=1 -dsp 
 
 	.include "testutils.inc"
diff --git a/sim/testsuite/sh/pshlr.s b/sim/testsuite/sh/pshlr.s
index 36cb47f41880..64e5a4372e8e 100644
--- a/sim/testsuite/sh/pshlr.s
+++ b/sim/testsuite/sh/pshlr.s
@@ -1,6 +1,5 @@
 # sh testcase for pshl <reg>
-# mach: all
-# as(sh):	-defsym sim_cpu=0
+# mach: shdsp
 # as(shdsp):	-defsym sim_cpu=1 -dsp 
 
 	.include "testutils.inc"
-- 
2.33.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-09  6:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-09  6:27 [PATCH] sim: sh: simplify testsuite a bit Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).