public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/2] sim: testsuite: allow tests to declare expected exit status
@ 2021-01-05  6:55 Mike Frysinger
  2021-01-05  6:55 ` [PATCH 2/2] sim: m32r: clean up redundant test coverage Mike Frysinger
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Mike Frysinger @ 2021-01-05  6:55 UTC (permalink / raw)
  To: gdb-patches

Some tests want to verify they can control the exit status, and
allowing any non-zero value would allow tests to silently fail:
if it crashed & exited 1, or forced all non-zero to 1, then we
wouldn't be able to differentiate with a test exiting with a
status like 47.

Extend the test harness to allow tests to declare their expected
exit status that would be defined as a "pass".  This requires a
small tweak to the sim_run API to return the status directly, but
that shouldn't be a big deal as it's only used by sim code.
---
 sim/testsuite/lib/sim-defs.exp              | 23 +++++++++++----------
 sim/testsuite/sim/cris/c/c.exp              |  7 ++++++-
 sim/testsuite/sim/cris/hw/rv-n-cris/rvc.exp |  2 +-
 3 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp
index b8ce230f13c3..43a07050f508 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -62,7 +62,7 @@ proc sim_compile { source dest type options } {
 #	timeout=val	- set the timeout to val for this run
 #
 # The result is a list of two elements.
-# The first is one of pass/fail/etc.
+# The first is the program's exit status (0/1/etc...).
 # The second is the program's output.
 #
 # This is different than the sim_load routine provided by
@@ -156,15 +156,7 @@ proc sim_run { prog sim_opts prog_opts redir options } {
 	remote_file host delete $prog
     }
 
-    # ??? Not sure the test for pass/fail is right.
-    # We just care that the simulator ran correctly, not whether the simulated
-    # program return 0 or non-zero from `main'.
-    set status fail
-    if { $return_code == 0 } {
-	set status pass
-    }
-
-    return [list $status $output]
+    return [list $return_code $output]
 }
 
 # Run testcase NAME.
@@ -183,6 +175,7 @@ proc sim_run { prog sim_opts prog_opts redir options } {
 # cc[(mach-list)]: <compiler options>
 # sim[(mach-list)]: <simulator options>
 # progopts: <arguments to the program being simulated>
+# status: program exit status to treat as "pass"
 # output: program output pattern to match with string-match
 # xerror: program is expected to return with a "failure" exit code
 # xfail: <PRMS-opt> <target-triplets-where-test-fails>
@@ -223,6 +216,7 @@ proc run_sim_test { name requested_machs } {
     set opts(cc) ""
     set opts(progopts) ""
     set opts(sim) ""
+    set opts(status) "0"
     set opts(output) ""
     set opts(mach) ""
     set opts(timeout) ""
@@ -385,15 +379,21 @@ proc run_sim_test { name requested_machs } {
 	}
 
 	set result [sim_run ${name}.x "$opts(sim,$mach) $global_sim_options" "$opts(progopts)" "" "$options"]
-	set status [lindex $result 0]
+	set return_code [lindex $result 0]
 	set output [lindex $result 1]
 
+	set status fail
+	if { $return_code == $opts(status) } {
+	    set status pass
+	}
+
 	if { "$status" == "pass" } {
 	    if { "$opts(xerror)" == "no" } {
 		if [string match $opts(output) $output] {
 		    pass "$mach $testname"
 		    file delete ${name}.o ${name}.x
 		} else {
+		    verbose -log "status:  $return_code" 3
 		    verbose -log "output:  $output" 3
 		    verbose -log "pattern: $opts(output)" 3
 		    fail "$mach $testname (execution)"
@@ -410,6 +410,7 @@ proc run_sim_test { name requested_machs } {
 		    pass "$mach $testname"
 		    file delete ${name}.o ${name}.x
 		} else {
+		    verbose -log "status:  $return_code" 3
 		    verbose -log "output:  $output" 3
 		    verbose -log "pattern: $opts(output)" 3
 		    fail "$mach $testname (execution)"
diff --git a/sim/testsuite/sim/cris/c/c.exp b/sim/testsuite/sim/cris/c/c.exp
index c9df98381e64..c872fcb97d5b 100644
--- a/sim/testsuite/sim/cris/c/c.exp
+++ b/sim/testsuite/sim/cris/c/c.exp
@@ -210,9 +210,14 @@ foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] {
 
     set result [sim_run $dest "$opts(sim,$mach)" "$opts(progoptions)" \
 	"" "$opts(simenv)"]
-    set status [lindex $result 0]
+    set return_code [lindex $result 0]
     set output [lindex $result 1]
 
+    set status fail
+    if { $return_code == 0 } {
+	set status pass
+    }
+
     if { "$status" == "pass" } {
 	if { "$opts(xerror)" == "no" } {
 	    if [string match $opts(output) $output] {
diff --git a/sim/testsuite/sim/cris/hw/rv-n-cris/rvc.exp b/sim/testsuite/sim/cris/hw/rv-n-cris/rvc.exp
index 98fc717ed761..0f9ecec32a26 100644
--- a/sim/testsuite/sim/cris/hw/rv-n-cris/rvc.exp
+++ b/sim/testsuite/sim/cris/hw/rv-n-cris/rvc.exp
@@ -67,7 +67,7 @@ proc sim_has_rv_and_cris {} {
     set return_code [lindex $result 0]
     set output [lindex $result 1]
 
-    if { "$return_code" == "pass" } {
+    if { $return_code == 0 } {
 	return 1
     }
 
-- 
2.28.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/2] sim: m32r: clean up redundant test coverage
  2021-01-05  6:55 [PATCH 1/2] sim: testsuite: allow tests to declare expected exit status Mike Frysinger
@ 2021-01-05  6:55 ` Mike Frysinger
  2021-01-05  7:30 ` [PATCH] sim: frv: " Mike Frysinger
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2021-01-05  6:55 UTC (permalink / raw)
  To: gdb-patches

The m32r-elf subdir contained three tests:
* exit47: A program to test exit status of 47 from sim.
* hello: Standard "hello world" output program.
* loop: An infinite loop program.

There's already a sim/m32r/hello.ms test that does exactly the same
thing as m32r-elf/hello.s, so we can delete that.

The loop.s test is never referenced anywhere, and is all of 2 lines.
Anyone who really needs a while(1); test case and re-implement it
themselves locally.

That leaves the single exit47 test.  Now that the sim test harness
supports testing for custom exit status, we can easily move that to
sim/m32r/exit47.ms to maintain test coverage.

The remaining differences between m32r-elf & sim/m32r are:
* m32r-elf/ runs for m32r-*-elf while sim/m32r/ runs for m32r*-*-*.
* m32r-elf/ runs "*.s" files while sim/m32r/ runs "*.ms" files.

On closer inspection, these are also meaningless distinctions:
* There is nothing specific to the tests that require an *-elf
  target.  Normally that would mean newlib+libgloss type stuff,
  but there's no such requirement in m32r-elf/.
* The ".s" suffix is the standard "this is an assembly file"
  suffix.  Turns out ".ms" is just how sim/m32r/ (and a few other
  CGEN based targets) categorize/bucket test cases.  It simply
  means "miscellaneous .s" as in "this is an assembly file, and
  run/bucket its test results in the miscellaneous category".

So moving m32r-elf/exit47.s to sim/m32r/exit47.ms makes sense and
simplifies things quite a bit for the target while also slightly
increasing the coverage for some tuples.
---
 sim/testsuite/ChangeLog                       |    6 +
 sim/testsuite/configure                       |    5 -
 sim/testsuite/configure.ac                    |    3 -
 sim/testsuite/m32r-elf/ChangeLog              |   18 -
 sim/testsuite/m32r-elf/Makefile.in            |  156 -
 sim/testsuite/m32r-elf/configure              | 2984 -----------------
 sim/testsuite/m32r-elf/configure.ac           |   18 -
 sim/testsuite/m32r-elf/hello.s                |   17 -
 sim/testsuite/m32r-elf/loop.s                 |    2 -
 .../{m32r-elf/exit47.s => sim/m32r/exit47.ms} |    4 +
 10 files changed, 10 insertions(+), 3203 deletions(-)
 delete mode 100644 sim/testsuite/m32r-elf/ChangeLog
 delete mode 100644 sim/testsuite/m32r-elf/Makefile.in
 delete mode 100755 sim/testsuite/m32r-elf/configure
 delete mode 100644 sim/testsuite/m32r-elf/configure.ac
 delete mode 100644 sim/testsuite/m32r-elf/hello.s
 delete mode 100644 sim/testsuite/m32r-elf/loop.s
 rename sim/testsuite/{m32r-elf/exit47.s => sim/m32r/exit47.ms} (66%)

diff --git a/sim/testsuite/ChangeLog b/sim/testsuite/ChangeLog
index b792e283853b..0f122037fb5c 100644
--- a/sim/testsuite/ChangeLog
+++ b/sim/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2021-01-05  Mike Frysinger  <vapier@gentoo.org>
+
+	* configure.ac (target): Delete m32r-*-elf case.
+	* configure: Regenerate.
+	* m32r-elf/: Delete directory.
+
 2021-01-04  Mike Frysinger  <vapier@gentoo.org>
 
 	* configure: Regenerate.
diff --git a/sim/testsuite/configure b/sim/testsuite/configure
index 6f0464dc14a6..c6c0c5cac8b5 100755
--- a/sim/testsuite/configure
+++ b/sim/testsuite/configure
@@ -647,7 +647,6 @@ host_alias
 target_alias'
 ac_subdirs_all='d10v-elf
 frv-elf
-m32r-elf
 mips64el-elf'
 
 # Initialize some variables set by options.
@@ -1839,10 +1838,6 @@ subdirs="$subdirs d10v-elf"
     frv-*-elf )
 	subdirs="$subdirs frv-elf"
 
-	;;
-    m32r-*-elf )
-	subdirs="$subdirs m32r-elf"
-
 	;;
     mips64el-*-elf )
         subdirs="$subdirs mips64el-elf"
diff --git a/sim/testsuite/configure.ac b/sim/testsuite/configure.ac
index faaf38dc8879..962c0930d63b 100644
--- a/sim/testsuite/configure.ac
+++ b/sim/testsuite/configure.ac
@@ -19,9 +19,6 @@ case ${target} in
     frv-*-elf )
 	AC_CONFIG_SUBDIRS(frv-elf)
 	;;
-    m32r-*-elf )
-	AC_CONFIG_SUBDIRS(m32r-elf)
-	;;
     mips64el-*-elf )
         AC_CONFIG_SUBDIRS(mips64el-elf)
 	;;
diff --git a/sim/testsuite/m32r-elf/ChangeLog b/sim/testsuite/m32r-elf/ChangeLog
deleted file mode 100644
index 78512ec30f54..000000000000
--- a/sim/testsuite/m32r-elf/ChangeLog
+++ /dev/null
diff --git a/sim/testsuite/m32r-elf/Makefile.in b/sim/testsuite/m32r-elf/Makefile.in
deleted file mode 100644
index f6a84ff1113e..000000000000
--- a/sim/testsuite/m32r-elf/Makefile.in
+++ /dev/null
@@ -1,156 +0,0 @@
-# Makefile for regression testing the m32r simulator.
-# Copyright (C) 1998-2021 Free Software Foundation, Inc.
-
-# This file is part of GDB.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-VPATH = @srcdir@
-srcdir = @srcdir@
-srcroot = $(srcdir)/../../..
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-host_alias = @host_alias@
-target_alias = @target_alias@
-program_transform_name = @program_transform_name@
-build_canonical = @build@
-host_canonical = @host@
-target_canonical = @target@
-target_cpu = @target_cpu@
-
-
-SHELL = @SHELL@
-SUBDIRS = @subdirs@
-RPATH_ENVVAR = @RPATH_ENVVAR@
-
-EXPECT = `if [ -f ../../../expect/expect ] ; then \
-          echo ../../../expect/expect ; \
-          else echo expect ; fi`
-
-RUNTEST = $(RUNTEST_FOR_TARGET)
-
-RUNTESTFLAGS =
-
-RUNTEST_FOR_TARGET = `\
-  if [ -f $${srcroot}/dejagnu/runtest ]; then \
-    echo $${srcroot}/dejagnu/runtest; \
-  else \
-    if [ "$(host_canonical)" = "$(target_canonical)" ]; then \
-      echo runtest; \
-    else \
-      t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \
-    fi; \
-  fi`
-
-
-AS_FOR_TARGET = `\
-  if [ -x ../../../gas/as-new ]; then \
-    echo ../../../gas/as-new ; \
-  else \
-    echo $(target_alias)-as ; \
-  fi`
-
-LD_FOR_TARGET = `\
-  if [ -x ../../../ld/ld-new ]; then \
-    echo ../../../ld/ld-new ; \
-  else \
-    echo $(target_alias)-ld ; \
-  fi`
-
-RUN_FOR_TARGET = `\
-  if [ -x ../../../sim/${target_cpu}/run ]; then \
-    echo ../../../sim/${target_cpu}/run ; \
-  else \
-    echo $(target_alias)-run ; \
-  fi`
-
-TESTS = \
-	hello.ok \
-	exit47.ko
-
-check: sanity $(TESTS)
-sanity:
-	@eval echo AS_FOR_TARGET = $(AS_FOR_TARGET)
-	@eval echo LD_FOR_TARGET = $(LD_FOR_TARGET)
-	@eval echo RUN_FOR_TARGET = $(RUN_FOR_TARGET)
-
-
-
-# Rules for running all the tests, put into three types
-# exit success, exit fail, print "Hello World"
-
-.u.log:
-	uudecode $*.u
-	$(RUN_FOR_TARGET) $* > $*.log
-
-
-# Rules for running the tests
-
-.SUFFIXES: .u .ok .run .hi .ko
-.run.ok:
-	rm -f tmp-$* $*.hi
-	ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$*
-	mv tmp-$* $*.ok
-.run.hi:
-	rm -f tmp-$* $*.hi diff-$*
-	ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$*
-	echo "Hello World" | diff - tmp-$* > diff-$*
-	cat tmp-$* diff-$* > $*.hi
-.run.ko:
-	rm -f tmp-$* $*.ko
-	set +e ; \
-	ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$* ; \
-	if [ $$? -eq 47 ] ; then \
-	  exit 0 ; \
-	else \
-	  exit 1 ; \
-	fi
-	mv tmp-$* $*.ko
-
-
-# Rules for building all the tests and packing them into
-# uuencoded files.
-
-uuencode: em-pstr.u em-e0.u em-e47.u em-pchr.u
-
-.SUFFIXES: .u .s .run
-.s.u:
-	rm -f $*.o $*.run
-	$(AS_FOR_TARGET) $(srcdir)/$*.s -o $*.o
-	$(LD_FOR_TARGET) -o $* $*.o
-	uuencode < $* $* > $*.u
-	rm -f $*.o $*
-.s.run:
-	rm -f $*.o $*.run
-	$(AS_FOR_TARGET) $(srcdir)/$*.s -o $*.o
-	$(LD_FOR_TARGET) -o $*.run $*.o
-	rm -f $*.o $*
-
-
-clean mostlyclean:
-	rm -f *~ core *.o a.out
-	rm -f $(TESTS)
-
-distclean maintainer-clean realclean: clean
-	rm -f *~ core
-	rm -f Makefile config.status *-init.exp
-	rm -fr *.log summary detail *.plog *.sum *.psum site.*
-
-Makefile : Makefile.in config.status
-	$(SHELL) config.status
-
-config.status: configure
-	$(SHELL) config.status --recheck
diff --git a/sim/testsuite/m32r-elf/configure.ac b/sim/testsuite/m32r-elf/configure.ac
deleted file mode 100644
index 278d84d0e825..000000000000
--- a/sim/testsuite/m32r-elf/configure.ac
+++ /dev/null
@@ -1,18 +0,0 @@
-dnl Process this file file with autoconf to produce a configure script.
-dnl This file is a shell script fragment that supplies the information
-dnl necessary to tailor a template configure script into the configure
-dnl script appropriate for this directory.  For more information, check
-dnl any existing configure script.
-
-dnl FIXME - think of a truly uniq file to this directory
-AC_INIT(Makefile.in)
-
-CC=${CC-cc}
-AC_SUBST(CC)
-AC_CONFIG_AUX_DIR(../../..)
-AC_CANONICAL_SYSTEM
-
-AC_SUBST(target_cpu)
-
-
-AC_OUTPUT(Makefile)
diff --git a/sim/testsuite/m32r-elf/hello.s b/sim/testsuite/m32r-elf/hello.s
deleted file mode 100644
index a61693462fba..000000000000
--- a/sim/testsuite/m32r-elf/hello.s
+++ /dev/null
@@ -1,17 +0,0 @@
-
-	.globl _start
-_start:
-
-; write (hello world)
-	ldi8 r3,#14
-	ld24 r2,#hello
-	ldi8 r1,#1
-	ldi8 r0,#5
-	trap #0
-; exit (0)
-	ldi8 r1,#0
-	ldi8 r0,#1
-	trap #0
-
-length:	.long 14
-hello:	.ascii "Hello World!\r\n"
diff --git a/sim/testsuite/m32r-elf/loop.s b/sim/testsuite/m32r-elf/loop.s
deleted file mode 100644
index b24cfb41fddc..000000000000
--- a/sim/testsuite/m32r-elf/loop.s
+++ /dev/null
@@ -1,2 +0,0 @@
-	.globl _start
-_start:	bra _start
diff --git a/sim/testsuite/m32r-elf/exit47.s b/sim/testsuite/sim/m32r/exit47.ms
similarity index 66%
rename from sim/testsuite/m32r-elf/exit47.s
rename to sim/testsuite/sim/m32r/exit47.ms
index ab814e3ab9a4..20074f6e7b2c 100644
--- a/sim/testsuite/m32r-elf/exit47.s
+++ b/sim/testsuite/sim/m32r/exit47.ms
@@ -1,3 +1,7 @@
+# mach(): m32r m32rx
+# status: 47
+# output:
+
 	;; Return with exit code 47.
 
 	.globl _start
-- 
2.28.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] sim: frv: clean up redundant test coverage
  2021-01-05  6:55 [PATCH 1/2] sim: testsuite: allow tests to declare expected exit status Mike Frysinger
  2021-01-05  6:55 ` [PATCH 2/2] sim: m32r: clean up redundant test coverage Mike Frysinger
@ 2021-01-05  7:30 ` Mike Frysinger
  2021-01-05  7:34 ` [PATCH] sim: mips: delete empty stub test dir Mike Frysinger
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2021-01-05  7:30 UTC (permalink / raw)
  To: gdb-patches

The frv-elf subdir contained five tests:
* cache: A cache test of some sort.
* exit47: A program to test exit status of 47 from sim.
* grloop: Some basic limited loop test program.
* hello: Standard "hello world" output program.
* loop: An infinite loop program.

The loop.s test is never referenced anywhere, and is all of 2 lines.
Anyone who really needs a while(1); test case and re-implement it
themselves locally.

The cache.s code isn't referenced anywhere because it requires some
custom args to the run program, and when this testcase was added, we
didn't have any support for that.  We do now, so we can add a header
to enable that.  Turns out the code crashes even with those, so turn
around and mark it xfail.  Maybe someone someday will care.

That leaves the small exit47, grloop, and hello tests.  Now that the
sim test harness supports testing for custom exit status, we can move
them all to sim/frv/ to maintain test coverage.

The remaining differences between frv-elf & sim/frv are:
* frv-elf/ runs for frv-*-elf while sim/frv/ runs for frv*-*-*.
* frv-elf/ runs "*.s" files while sim/frv/ only has .cgs and such.

On closer inspection, these are also meaningless distinctions:
* There is nothing specific to the tests that require an *-elf
  target.  Normally that would mean newlib+libgloss type stuff,
  but there's no such requirement in frv-elf/.
* The ".s" suffix is the standard "this is an assembly file" suffix.
  Since FRV is a CGEN target, we can reuse the existing convention of
  ".ms" to mean "miscellaneous .s" as in "this is an assembly file,
  and run/bucket its test results in the miscellaneous category".

So moving frv-elf/{cache,exit47,grloop,hello}.s to sim/frv/*.ms makes
sense and simplifies things quite a bit for the target while also
slightly increasing the coverage for some tuples.
---
 sim/testsuite/ChangeLog                       |    6 +
 sim/testsuite/configure                       |    5 -
 sim/testsuite/configure.ac                    |    3 -
 sim/testsuite/frv-elf/ChangeLog               |   48 -
 sim/testsuite/frv-elf/Makefile.in             |  158 -
 sim/testsuite/frv-elf/configure               | 2984 -----------------
 sim/testsuite/frv-elf/configure.ac            |   18 -
 sim/testsuite/frv-elf/loop.s                  |    2 -
 sim/testsuite/sim/frv/ChangeLog               |    6 +
 .../{frv-elf/cache.s => sim/frv/cache.ms}     |    6 +-
 .../{frv-elf/exit47.s => sim/frv/exit47.ms}   |    6 +
 .../{frv-elf/grloop.s => sim/frv/grloop.ms}   |    3 +
 .../{frv-elf/hello.s => sim/frv/hello.ms}     |    3 +
 sim/testsuite/sim/frv/misc.exp                |   19 +
 14 files changed, 48 insertions(+), 3219 deletions(-)
 delete mode 100644 sim/testsuite/frv-elf/ChangeLog
 delete mode 100644 sim/testsuite/frv-elf/Makefile.in
 delete mode 100755 sim/testsuite/frv-elf/configure
 delete mode 100644 sim/testsuite/frv-elf/configure.ac
 delete mode 100644 sim/testsuite/frv-elf/loop.s
 rename sim/testsuite/{frv-elf/cache.s => sim/frv/cache.ms} (95%)
 rename sim/testsuite/{frv-elf/exit47.s => sim/frv/exit47.ms} (50%)
 rename sim/testsuite/{frv-elf/grloop.s => sim/frv/grloop.ms} (86%)
 rename sim/testsuite/{frv-elf/hello.s => sim/frv/hello.ms} (86%)
 create mode 100644 sim/testsuite/sim/frv/misc.exp

diff --git a/sim/testsuite/ChangeLog b/sim/testsuite/ChangeLog
index 0f122037fb5c..a5ca8f4665f8 100644
--- a/sim/testsuite/ChangeLog
+++ b/sim/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2021-01-05  Mike Frysinger  <vapier@gentoo.org>
+
+	* configure.ac (target): Delete frv-*-elf case.
+	* configure: Regenerate.
+	* frv-elf/: Delete directory.
+
 2021-01-05  Mike Frysinger  <vapier@gentoo.org>
 
 	* configure.ac (target): Delete m32r-*-elf case.
diff --git a/sim/testsuite/configure.ac b/sim/testsuite/configure.ac
index 962c0930d63b..71a16c9bd5c3 100644
--- a/sim/testsuite/configure.ac
+++ b/sim/testsuite/configure.ac
@@ -16,9 +16,6 @@ case ${target} in
     d10v-*-elf )
 	AC_CONFIG_SUBDIRS(d10v-elf)
 	;;
-    frv-*-elf )
-	AC_CONFIG_SUBDIRS(frv-elf)
-	;;
     mips64el-*-elf )
         AC_CONFIG_SUBDIRS(mips64el-elf)
 	;;
diff --git a/sim/testsuite/frv-elf/ChangeLog b/sim/testsuite/frv-elf/ChangeLog
deleted file mode 100644
index 904de02b9983..000000000000
--- a/sim/testsuite/frv-elf/ChangeLog
+++ /dev/null
diff --git a/sim/testsuite/frv-elf/Makefile.in b/sim/testsuite/frv-elf/Makefile.in
deleted file mode 100644
index dd9bc94fb718..000000000000
--- a/sim/testsuite/frv-elf/Makefile.in
+++ /dev/null
@@ -1,158 +0,0 @@
-# Makefile for regression testing the frv simulator.
-# Copyright (C) 1998-2021 Free Software Foundation, Inc.
-
-# This file is part of GDB.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-VPATH = @srcdir@
-srcdir = @srcdir@
-srcroot = $(srcdir)/../../..
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-host_alias = @host_alias@
-target_alias = @target_alias@
-program_transform_name = @program_transform_name@
-build_canonical = @build@
-host_canonical = @host@
-target_canonical = @target@
-target_cpu = @target_cpu@
-
-
-SHELL = @SHELL@
-SUBDIRS = @subdirs@
-RPATH_ENVVAR = @RPATH_ENVVAR@
-
-EXPECT = `if [ -f ../../../expect/expect ] ; then \
-          echo ../../../expect/expect ; \
-          else echo expect ; fi`
-
-RUNTEST = $(RUNTEST_FOR_TARGET)
-
-RUNTESTFLAGS =
-
-RUNTEST_FOR_TARGET = `\
-  if [ -f $${srcroot}/dejagnu/runtest ]; then \
-    echo $${srcroot}/dejagnu/runtest; \
-  else \
-    if [ "$(host_canonical)" = "$(target_canonical)" ]; then \
-      echo runtest; \
-    else \
-      t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \
-    fi; \
-  fi`
-
-
-AS_FOR_TARGET = `\
-  if [ -x ../../../gas/as-new ]; then \
-    echo ../../../gas/as-new ; \
-  else \
-    echo $(target_alias)-as ; \
-  fi`
-
-LD_FOR_TARGET = `\
-  if [ -x ../../../ld/ld-new ]; then \
-    echo ../../../ld/ld-new ; \
-  else \
-    echo $(target_alias)-ld ; \
-  fi`
-
-RUN_FOR_TARGET = `\
-  if [ -x ../../../sim/${target_cpu}/run ]; then \
-    echo ../../../sim/${target_cpu}/run ; \
-  else \
-    echo $(target_alias)-run ; \
-  fi`
-
-TESTS = \
-	exit47.ko \
-	grloop.ok \
-	hello.ok
-
-
-check: sanity $(TESTS)
-sanity:
-	@eval echo AS_FOR_TARGET = $(AS_FOR_TARGET)
-	@eval echo LD_FOR_TARGET = $(LD_FOR_TARGET)
-	@eval echo RUN_FOR_TARGET = $(RUN_FOR_TARGET)
-
-
-
-# Rules for running all the tests, put into three types
-# exit success, exit fail, print "Hello World"
-
-.u.log:
-	uudecode $*.u
-	$(RUN_FOR_TARGET) $* > $*.log
-
-
-# Rules for running the tests
-
-.SUFFIXES: .u .ok .run .hi .ko
-.run.ok:
-	rm -f tmp-$* $*.hi
-	ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$*
-	mv tmp-$* $*.ok
-.run.hi:
-	rm -f tmp-$* $*.hi diff-$*
-	ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$*
-	echo "Hello World" | diff - tmp-$* > diff-$*
-	cat tmp-$* diff-$* > $*.hi
-.run.ko:
-	rm -f tmp-$* $*.ko
-	set +e ; \
-	ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$* ; \
-	if [ $$? -eq 47 ] ; then \
-	  exit 0 ; \
-	else \
-	  exit 1 ; \
-	fi
-	mv tmp-$* $*.ko
-
-
-# Rules for building all the tests and packing them into
-# uuencoded files.
-
-uuencode: em-pstr.u em-e0.u em-e47.u em-pchr.u
-
-.SUFFIXES: .u .s .run
-.s.u:
-	rm -f $*.o $*.run
-	$(AS_FOR_TARGET) $(srcdir)/$*.s -o $*.o
-	$(LD_FOR_TARGET) -o $* $*.o
-	uuencode < $* $* > $*.u
-	rm -f $*.o $*
-.s.run:
-	rm -f $*.o $*.run
-	$(AS_FOR_TARGET) $(srcdir)/$*.s -o $*.o
-	$(LD_FOR_TARGET) -o $*.run $*.o
-	rm -f $*.o $*
-
-
-clean mostlyclean:
-	rm -f *~ core *.o a.out
-	rm -f $(TESTS)
-
-distclean maintainer-clean realclean: clean
-	rm -f *~ core
-	rm -f Makefile config.status *-init.exp
-	rm -fr *.log summary detail *.plog *.sum *.psum site.*
-
-Makefile : Makefile.in config.status
-	$(SHELL) config.status
-
-config.status: configure
-	$(SHELL) config.status --recheck
diff --git a/sim/testsuite/frv-elf/configure b/sim/testsuite/frv-elf/configure
deleted file mode 100755
index 5686b7e4eb2c..000000000000
--- a/sim/testsuite/frv-elf/configure
+++ /dev/null
diff --git a/sim/testsuite/frv-elf/configure.ac b/sim/testsuite/frv-elf/configure.ac
deleted file mode 100644
index 278d84d0e825..000000000000
--- a/sim/testsuite/frv-elf/configure.ac
+++ /dev/null
@@ -1,18 +0,0 @@
-dnl Process this file file with autoconf to produce a configure script.
-dnl This file is a shell script fragment that supplies the information
-dnl necessary to tailor a template configure script into the configure
-dnl script appropriate for this directory.  For more information, check
-dnl any existing configure script.
-
-dnl FIXME - think of a truly uniq file to this directory
-AC_INIT(Makefile.in)
-
-CC=${CC-cc}
-AC_SUBST(CC)
-AC_CONFIG_AUX_DIR(../../..)
-AC_CANONICAL_SYSTEM
-
-AC_SUBST(target_cpu)
-
-
-AC_OUTPUT(Makefile)
diff --git a/sim/testsuite/frv-elf/loop.s b/sim/testsuite/frv-elf/loop.s
deleted file mode 100644
index 8489c13c5697..000000000000
--- a/sim/testsuite/frv-elf/loop.s
+++ /dev/null
@@ -1,2 +0,0 @@
-	.global _start
-_start:	 bra icc0,0,_start
diff --git a/sim/testsuite/sim/frv/ChangeLog b/sim/testsuite/sim/frv/ChangeLog
index 75b7b545ca0c..37839fd42919 100644
--- a/sim/testsuite/sim/frv/ChangeLog
+++ b/sim/testsuite/sim/frv/ChangeLog
@@ -1,3 +1,9 @@
+2021-01-05  Mike Frysinger  <vapier@gentoo.org>
+
+	* cache.ms: New testcase from ../../frv-elf/.
+	* exit47.ms, grloop.ms, hello.ms: Likewise.
+	* misc.exp: New file.
+
 2004-03-01  Richard Sandiford  <rsandifo@redhat.com>
 
 	* allinsn.exp (all_machs): Add fr405 and fr450.
diff --git a/sim/testsuite/frv-elf/cache.s b/sim/testsuite/sim/frv/cache.ms
similarity index 95%
rename from sim/testsuite/frv-elf/cache.s
rename to sim/testsuite/sim/frv/cache.ms
index 2ed0e1e35a94..5b93f0100024 100644
--- a/sim/testsuite/frv-elf/cache.s
+++ b/sim/testsuite/sim/frv/cache.ms
@@ -1,5 +1,9 @@
-# run with --memory-region 0xff000000,4 --memory-region 0xfe000000,00404000
+# mach: frv fr500 fr550
+# sim: --memory-region 0xff000000,4 --memory-region 0xfe000000,00404000
+# xfail: "crashes with bad write" frv-*
+
 ; Exit with return code
+
 	.macro exit rc
 	setlos.p	#1,gr7
 	setlos          \rc,gr8
diff --git a/sim/testsuite/frv-elf/exit47.s b/sim/testsuite/sim/frv/exit47.ms
similarity index 50%
rename from sim/testsuite/frv-elf/exit47.s
rename to sim/testsuite/sim/frv/exit47.ms
index 70e56b3c4ab3..53306e5a871f 100644
--- a/sim/testsuite/frv-elf/exit47.s
+++ b/sim/testsuite/sim/frv/exit47.ms
@@ -1,3 +1,9 @@
+# mach: all
+# status: 47
+# output:
+
+	;; Return with exit code 47.
+
 	.global _start
 _start:
 	setlos	#47,gr8
diff --git a/sim/testsuite/frv-elf/grloop.s b/sim/testsuite/sim/frv/grloop.ms
similarity index 86%
rename from sim/testsuite/frv-elf/grloop.s
rename to sim/testsuite/sim/frv/grloop.ms
index 844ad1d2941e..00609637a17a 100644
--- a/sim/testsuite/frv-elf/grloop.s
+++ b/sim/testsuite/sim/frv/grloop.ms
@@ -1,3 +1,6 @@
+# mach: all
+# output:
+
 	.global _start
 _start:
 	setlo	0x0400,gr10
diff --git a/sim/testsuite/frv-elf/hello.s b/sim/testsuite/sim/frv/hello.ms
similarity index 86%
rename from sim/testsuite/frv-elf/hello.s
rename to sim/testsuite/sim/frv/hello.ms
index 0151febc02f2..117e4a6be83b 100644
--- a/sim/testsuite/frv-elf/hello.s
+++ b/sim/testsuite/sim/frv/hello.ms
@@ -1,3 +1,6 @@
+# mach: all
+# output: Hello World!\n
+
 	.global _start
 _start:
 
diff --git a/sim/testsuite/sim/frv/misc.exp b/sim/testsuite/sim/frv/misc.exp
new file mode 100644
index 000000000000..4245a81cb60a
--- /dev/null
+++ b/sim/testsuite/sim/frv/misc.exp
@@ -0,0 +1,19 @@
+# Miscellaneous FRV simulator testcases.
+
+if [istarget frv*-*] {
+    # load support procs (none yet)
+    # load_lib cgen.exp
+    # all machines
+    set all_machs "frv fr500 fr550 fr400 fr405 fr450"
+    set cpu_option -mcpu
+
+    # The .ms suffix is for "miscellaneous .s".
+    foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.ms]] {
+	# If we're only testing specific files and this isn't one of them,
+	# skip it.
+	if ![runtest_file_p $runtests $src] {
+	    continue
+	}
+	run_sim_test $src $all_machs
+    }
+}
-- 
2.28.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] sim: mips: delete empty stub test dir
  2021-01-05  6:55 [PATCH 1/2] sim: testsuite: allow tests to declare expected exit status Mike Frysinger
  2021-01-05  6:55 ` [PATCH 2/2] sim: m32r: clean up redundant test coverage Mike Frysinger
  2021-01-05  7:30 ` [PATCH] sim: frv: " Mike Frysinger
@ 2021-01-05  7:34 ` Mike Frysinger
  2021-01-05  8:17 ` [PATCH] sim: d10v: relocate tests & clean up test harness Mike Frysinger
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2021-01-05  7:34 UTC (permalink / raw)
  To: gdb-patches

No tests were ever added in here in the ~22 years since it was first
created.  Seems unlikely any tests will be added at this rate, and
the sim/mips/ testdir already has some (light) coverage for this
target.  So punt the tree.
---
 sim/testsuite/ChangeLog                 |    6 +
 sim/testsuite/configure                 |    7 +-
 sim/testsuite/configure.ac              |    3 -
 sim/testsuite/mips64el-elf/ChangeLog    |   19 -
 sim/testsuite/mips64el-elf/Makefile.in  |  170 --
 sim/testsuite/mips64el-elf/configure    | 2984 -----------------------
 sim/testsuite/mips64el-elf/configure.ac |   18 -
 7 files changed, 7 insertions(+), 3200 deletions(-)
 delete mode 100644 sim/testsuite/mips64el-elf/ChangeLog
 delete mode 100644 sim/testsuite/mips64el-elf/Makefile.in
 delete mode 100755 sim/testsuite/mips64el-elf/configure
 delete mode 100644 sim/testsuite/mips64el-elf/configure.ac

diff --git a/sim/testsuite/ChangeLog b/sim/testsuite/ChangeLog
index a5ca8f4665f8..8bc59f03b839 100644
--- a/sim/testsuite/ChangeLog
+++ b/sim/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2021-01-05  Mike Frysinger  <vapier@gentoo.org>
+
+	* configure.ac (target): Delete mips64el-*-elf case.
+	* configure: Regenerate.
+	* mips64el-elf/: Delete directory.
+
 2021-01-05  Mike Frysinger  <vapier@gentoo.org>
 
 	* configure.ac (target): Delete frv-*-elf case.
diff --git a/sim/testsuite/configure b/sim/testsuite/configure
index aed8a3501dca..764b39acf291 100755
--- a/sim/testsuite/configure
+++ b/sim/testsuite/configure
@@ -645,8 +645,7 @@ enable_option_checking
       ac_precious_vars='build_alias
 host_alias
 target_alias'
-ac_subdirs_all='d10v-elf
-mips64el-elf'
+ac_subdirs_all='d10v-elf'
 
 # Initialize some variables set by options.
 ac_init_help=
@@ -1833,10 +1832,6 @@ case ${target} in
 
 subdirs="$subdirs d10v-elf"
 
-	;;
-    mips64el-*-elf )
-        subdirs="$subdirs mips64el-elf"
-
 	;;
 esac
 
diff --git a/sim/testsuite/configure.ac b/sim/testsuite/configure.ac
index 71a16c9bd5c3..e878371fd98b 100644
--- a/sim/testsuite/configure.ac
+++ b/sim/testsuite/configure.ac
@@ -16,9 +16,6 @@ case ${target} in
     d10v-*-elf )
 	AC_CONFIG_SUBDIRS(d10v-elf)
 	;;
-    mips64el-*-elf )
-        AC_CONFIG_SUBDIRS(mips64el-elf)
-	;;
 esac
 
 sinclude(../configure.tgt)
diff --git a/sim/testsuite/mips64el-elf/ChangeLog b/sim/testsuite/mips64el-elf/ChangeLog
deleted file mode 100644
index 7717ca12b8c2..000000000000
--- a/sim/testsuite/mips64el-elf/ChangeLog
+++ /dev/null
@@ -1,19 +0,0 @@
-2020-10-06  Andrew Burgess  <andrew.burgess@embecosm.com>
-
-	* configure: Regnerate.
-	* configure.ac (AC_CONFIG_AUX_DIR): Update.
-
-2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
-
-	* configure: Regenerate.
-
-2005-01-07  Andrew Cagney  <cagney@gnu.org>
-
-	* configure.ac: Rename configure.in, require autoconf 2.59.
-	* configure: Re-generate.
-
-Thu Aug 13 22:37:29 EDT 1998  Jim Lemke  <jlemke@cygnus.com>
-
-	* Makefile.in, configure, configure.in:
-	Create a minimal testsuite.
-
diff --git a/sim/testsuite/mips64el-elf/Makefile.in b/sim/testsuite/mips64el-elf/Makefile.in
deleted file mode 100644
index 3a6057ee75c3..000000000000
--- a/sim/testsuite/mips64el-elf/Makefile.in
+++ /dev/null
@@ -1,170 +0,0 @@
-# Makefile for regression testing the GNU debugger.
-# Copyright (C) 1992-2021 Free Software Foundation, Inc.
-
-# This file is part of GDB.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-VPATH = @srcdir@
-srcdir = @srcdir@
-srcroot = $(srcdir)/..
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-host_alias = @host_alias@
-target_alias = @target_alias@
-program_transform_name = @program_transform_name@
-build_canonical = @build@
-host_canonical = @host@
-target_canonical = @target@
-target_cpu = @target_cpu@
-
-
-SHELL = /bin/sh
-SUBDIRS = @subdirs@
-RPATH_ENVVAR = @RPATH_ENVVAR@
-
-EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \
-          echo $${rootme}/../../expect/expect ; \
-          else echo expect ; fi`
-
-RUNTEST = $(RUNTEST_FOR_TARGET)
-
-RUNTESTFLAGS =
-
-RUNTEST_FOR_TARGET = `\
-  if [ -f $${srcdir}/../../../dejagnu/runtest ]; then \
-    echo $${srcdir}/../../../dejagnu/runtest; \
-  else \
-    if [ "$(host_canonical)" = "$(target_canonical)" ]; then \
-      echo runtest; \
-    else \
-      t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \
-    fi; \
-  fi`
-
-
-AS_FOR_TARGET = `\
-  if [ -x ../../../gas/as-new ]; then \
-    echo ../../../gas/as-new ; \
-  else \
-    echo $(target_alias)-as ; \
-  fi`
-
-LD_FOR_TARGET = `\
-  if [ -x ../../../ld/ld-new ]; then \
-    echo ../../../ld/ld-new ; \
-  else \
-    echo $(target_alias)-ld ; \
-  fi`
-
-RUN_FOR_TARGET = `\
-  if [ -x ../../../sim/mips/run ]; then \
-    echo ../../../sim/mips/run ; \
-  else \
-    echo $(target_alias)-run ; \
-  fi`
-
-TESTS = 
-
-check: sanity $(TESTS)
-sanity:
-	@eval echo AS_FOR_TARGET = $(AS_FOR_TARGET)
-	@eval echo LD_FOR_TARGET = $(LD_FOR_TARGET)
-	@eval echo RUN_FOR_TARGET = $(RUN_FOR_TARGET)
-
-
-
-# Rules for running all the tests, put into three types
-# exit success, exit fail, print "Hello World"
-
-.u.log:
-	uudecode $*.u
-	$(RUN_FOR_TARGET) $* > $*.log
-
-
-# Rules for running the tests
-
-.SUFFIXES: .u .uue .ok .ok .run .hi .ko .ko
-.run.ok:
-	rm -f tmp-$* $*.ok
-	ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$*
-	mv tmp-$* $*.ok
-.run.hi:
-	rm -f tmp-$* $*.hi diff-$*
-	ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$*
-	echo 'Hello World!' | diff - tmp-$* > diff-$*
-	cat tmp-$* diff-$* > $*.hi
-.run.ko:
-	rm -f tmp-$* $*.ko
-	set +e ; \
-	ulimit -t 5 ; $(RUN_FOR_TARGET) $*.run > tmp-$* ; \
-	if [ $$? -eq 47 ] ; then \
-	  exit 0 ; \
-	else \
-	  exit 1 ; \
-	fi
-	mv tmp-$* $*.ko
-
-
-# Rules for building all the tests and packing them into
-# uuencoded files.
-
-.run.u:
-	uuencode < $*.run $*.run > $*.u
-	@echo "Move $*.u $*.uue"
-.uue.run:
-	uudecode $(srcdir)/$*.uue
-.o.run:
-	$(LD_FOR_TARGET) -Ttext 0xa0020000 -o $*.run $*.o
-.s.o:
-	$(AS_FOR_TARGET) -I $(srcdir) $(srcdir)/$*.s -o $*.o
-
-
-#
-# Standard
-#
-clean mostlyclean:
-	-rm -f *~ core *.o a.out *.x *.grt *.run tmp-* diff-*
-	rm -f $(TESTS)
-#	if [ x"${SUBDIRS}" != x ] ; then \
-#	    for dir in ${SUBDIRS}; \
-#	    do \
-#		    echo "$$dir:"; \
-#		    if [ -d $$dir ]; then \
-#			    (cd $$dir; $(MAKE) clean); \
-#		    fi; \
-#	    done ; \
-#	else true; fi
-
-distclean maintainer-clean realclean: clean
-	-rm -f *~ core
-	-rm -f Makefile config.status *-init.exp
-	-rm -fr *.log summary detail *.plog *.sum *.psum site.*
-#	if [ x"${SUBDIRS}" != x ] ; then \
-#	    for dir in ${SUBDIRS}; \
-#	    do \
-#		    echo "$$dir:"; \
-#		    if [ -d $$dir ]; then \
-#			    (cd $$dir; $(MAKE) distclean); \
-#		    fi; \
-#	    done ; \
-#	else true; fi
-
-Makefile : Makefile.in config.status
-	$(SHELL) config.status
-
-config.status: configure
-	$(SHELL) config.status --recheck
diff --git a/sim/testsuite/mips64el-elf/configure b/sim/testsuite/mips64el-elf/configure
deleted file mode 100755
index 5686b7e4eb2c..000000000000
--- a/sim/testsuite/mips64el-elf/configure
+++ /dev/null
diff --git a/sim/testsuite/mips64el-elf/configure.ac b/sim/testsuite/mips64el-elf/configure.ac
deleted file mode 100644
index 278d84d0e825..000000000000
--- a/sim/testsuite/mips64el-elf/configure.ac
+++ /dev/null
@@ -1,18 +0,0 @@
-dnl Process this file file with autoconf to produce a configure script.
-dnl This file is a shell script fragment that supplies the information
-dnl necessary to tailor a template configure script into the configure
-dnl script appropriate for this directory.  For more information, check
-dnl any existing configure script.
-
-dnl FIXME - think of a truly uniq file to this directory
-AC_INIT(Makefile.in)
-
-CC=${CC-cc}
-AC_SUBST(CC)
-AC_CONFIG_AUX_DIR(../../..)
-AC_CANONICAL_SYSTEM
-
-AC_SUBST(target_cpu)
-
-
-AC_OUTPUT(Makefile)
-- 
2.28.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] sim: d10v: relocate tests & clean up test harness
  2021-01-05  6:55 [PATCH 1/2] sim: testsuite: allow tests to declare expected exit status Mike Frysinger
                   ` (2 preceding siblings ...)
  2021-01-05  7:34 ` [PATCH] sim: mips: delete empty stub test dir Mike Frysinger
@ 2021-01-05  8:17 ` Mike Frysinger
  2021-01-06  0:31 ` [PATCH] sim: testsuite: delete configure script Mike Frysinger
  2021-01-11 23:34 ` [PATCH 1/2] sim: testsuite: allow tests to declare expected exit status Mike Frysinger
  5 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2021-01-05  8:17 UTC (permalink / raw)
  To: gdb-patches

This is the only target using a dir directly under testsuite/.  All
others use sim/<arch>/ instead.  Relocate it so all targets look the
same, and so we can leverage the common test harness.

We drop loop.s in the process because it was never referenced and
was just 2 lines of code.

All other test files are moved & have directives added to the top so
that the test harness can invoke them correctly.
---
 sim/testsuite/ChangeLog                       |    7 +
 sim/testsuite/configure                       |  159 +-
 sim/testsuite/configure.ac                    |    7 -
 sim/testsuite/d10v-elf/Makefile.in            |  180 -
 sim/testsuite/d10v-elf/configure              | 2984 -----------------
 sim/testsuite/d10v-elf/configure.ac           |   18 -
 sim/testsuite/d10v-elf/exit47.s               |    4 -
 sim/testsuite/d10v-elf/loop.s                 |    6 -
 .../{d10v-elf => sim/d10v}/ChangeLog          |    5 +
 sim/testsuite/sim/d10v/allinsn.exp            |   17 +
 .../{d10v-elf/t-trap.s => sim/d10v/exit47.s}  |    5 +-
 sim/testsuite/{d10v-elf => sim/d10v}/hello.s  |    3 +
 .../{d10v-elf => sim/d10v}/t-ae-ld-d.s        |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-ld-i.s        |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-ld-id.s       |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-ld-im.s       |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-ld-ip.s       |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-ld2w-d.s      |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-ld2w-i.s      |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-ld2w-id.s     |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-ld2w-im.s     |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-ld2w-ip.s     |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-st-d.s        |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-st-i.s        |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-st-id.s       |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-st-im.s       |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-st-ip.s       |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-st-is.s       |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-st2w-d.s      |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-st2w-i.s      |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-st2w-id.s     |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-st2w-im.s     |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-st2w-ip.s     |    6 +-
 .../{d10v-elf => sim/d10v}/t-ae-st2w-is.s     |    6 +-
 sim/testsuite/{d10v-elf => sim/d10v}/t-dbt.s  |    7 +-
 .../{d10v-elf => sim/d10v}/t-ld-st.s          |    4 +
 sim/testsuite/{d10v-elf => sim/d10v}/t-mac.s  |    6 +-
 .../{d10v-elf => sim/d10v}/t-macros.i         |   12 +-
 .../{d10v-elf => sim/d10v}/t-mod-ld-pre.s     |   56 +-
 sim/testsuite/{d10v-elf => sim/d10v}/t-msbu.s |    6 +-
 .../{d10v-elf => sim/d10v}/t-mulxu.s          |    6 +-
 .../{d10v-elf => sim/d10v}/t-mvtac.s          |    6 +-
 sim/testsuite/{d10v-elf => sim/d10v}/t-mvtc.s |    9 +-
 sim/testsuite/{d10v-elf => sim/d10v}/t-rac.s  |    4 +
 .../{d10v-elf => sim/d10v}/t-rachi.s          |    4 +
 sim/testsuite/{d10v-elf => sim/d10v}/t-rdt.s  |    7 +-
 sim/testsuite/{d10v-elf => sim/d10v}/t-rep.s  |    8 +-
 .../{d10v-elf => sim/d10v}/t-rie-xx.s         |    6 +-
 sim/testsuite/{d10v-elf => sim/d10v}/t-rte.s  |    6 +-
 sim/testsuite/{d10v-elf => sim/d10v}/t-sac.s  |    4 +
 .../{d10v-elf => sim/d10v}/t-sachi.s          |    4 +
 sim/testsuite/{d10v-elf => sim/d10v}/t-sadd.s |    6 +-
 sim/testsuite/{d10v-elf => sim/d10v}/t-slae.s |    4 +
 sim/testsuite/{d10v-elf => sim/d10v}/t-sp.s   |    6 +-
 sim/testsuite/{d10v-elf => sim/d10v}/t-sub.s  |    4 +
 .../{d10v-elf => sim/d10v}/t-sub2w.s          |   16 +-
 sim/testsuite/{d10v-elf => sim/d10v}/t-subi.s |    4 +
 sim/testsuite/sim/d10v/t-trap.s               |   10 +
 58 files changed, 299 insertions(+), 3433 deletions(-)
 delete mode 100644 sim/testsuite/d10v-elf/Makefile.in
 delete mode 100755 sim/testsuite/d10v-elf/configure
 delete mode 100644 sim/testsuite/d10v-elf/configure.ac
 delete mode 100644 sim/testsuite/d10v-elf/exit47.s
 delete mode 100644 sim/testsuite/d10v-elf/loop.s
 rename sim/testsuite/{d10v-elf => sim/d10v}/ChangeLog (96%)
 create mode 100644 sim/testsuite/sim/d10v/allinsn.exp
 rename sim/testsuite/{d10v-elf/t-trap.s => sim/d10v/exit47.s} (52%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/hello.s (54%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-ld-d.s (76%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-ld-i.s (79%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-ld-id.s (78%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-ld-im.s (79%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-ld-ip.s (79%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-ld2w-d.s (77%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-ld2w-i.s (80%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-ld2w-id.s (79%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-ld2w-im.s (80%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-ld2w-ip.s (80%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-st-d.s (76%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-st-i.s (79%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-st-id.s (78%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-st-im.s (79%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-st-ip.s (79%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-st-is.s (79%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-st2w-d.s (77%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-st2w-i.s (80%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-st2w-id.s (79%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-st2w-im.s (80%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-st2w-ip.s (80%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ae-st2w-is.s (79%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-dbt.s (88%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-ld-st.s (88%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-mac.s (95%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-macros.i (97%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-mod-ld-pre.s (90%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-msbu.s (87%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-mulxu.s (87%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-mvtac.s (84%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-mvtc.s (95%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-rac.s (82%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-rachi.s (87%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-rdt.s (75%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-rep.s (90%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-rie-xx.s (79%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-rte.s (78%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-sac.s (85%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-sachi.s (83%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-sadd.s (92%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-slae.s (92%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-sp.s (78%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-sub.s (92%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-sub2w.s (93%)
 rename sim/testsuite/{d10v-elf => sim/d10v}/t-subi.s (92%)
 create mode 100644 sim/testsuite/sim/d10v/t-trap.s

diff --git a/sim/testsuite/ChangeLog b/sim/testsuite/ChangeLog
index 8bc59f03b839..cb9a25a62c6c 100644
--- a/sim/testsuite/ChangeLog
+++ b/sim/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2021-01-05  Mike Frysinger  <vapier@gentoo.org>
+
+	* configure.ac (target): Delete d10v-*-elf case.
+	* configure: Regenerate.
+	* d10v-elf/: Move directory ...
+	* sim/d10v/: ... here.
+
 2021-01-05  Mike Frysinger  <vapier@gentoo.org>
 
 	* configure.ac (target): Delete mips64el-*-elf case.
diff --git a/sim/testsuite/configure b/sim/testsuite/configure
index 764b39acf291..c90da3e6fff4 100755
--- a/sim/testsuite/configure
+++ b/sim/testsuite/configure
@@ -582,11 +582,9 @@ PACKAGE_BUGREPORT=
 PACKAGE_URL=
 
 ac_unique_file="common/bits-tst.c"
-enable_option_checking=no
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
 sim_arch
-subdirs
 target_os
 target_vendor
 target_cpu
@@ -645,7 +643,7 @@ enable_option_checking
       ac_precious_vars='build_alias
 host_alias
 target_alias'
-ac_subdirs_all='d10v-elf'
+
 
 # Initialize some variables set by options.
 ac_init_help=
@@ -1825,16 +1823,6 @@ test -n "$target_alias" &&
   program_prefix=${target_alias}-
 
 
-# Configure sub-directory for appropriate targets
-case ${target} in
-    d10v-*-elf )
-
-
-subdirs="$subdirs d10v-elf"
-
-	;;
-esac
-
 
 # WHEN ADDING ENTRIES TO THIS MATRIX:
 
@@ -3100,151 +3088,6 @@ if test "$no_create" != yes; then
   # would make configure fail if this is the last instruction.
   $ac_cs_success || as_fn_exit 1
 fi
-
-#
-# CONFIG_SUBDIRS section.
-#
-if test "$no_recursion" != yes; then
-
-  # Remove --cache-file, --srcdir, and --disable-option-checking arguments
-  # so they do not pile up.
-  ac_sub_configure_args=
-  ac_prev=
-  eval "set x $ac_configure_args"
-  shift
-  for ac_arg
-  do
-    if test -n "$ac_prev"; then
-      ac_prev=
-      continue
-    fi
-    case $ac_arg in
-    -cache-file | --cache-file | --cache-fil | --cache-fi \
-    | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
-      ac_prev=cache_file ;;
-    -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
-    | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
-    | --c=*)
-      ;;
-    --config-cache | -C)
-      ;;
-    -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
-      ac_prev=srcdir ;;
-    -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
-      ;;
-    -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
-      ac_prev=prefix ;;
-    -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
-      ;;
-    --disable-option-checking)
-      ;;
-    *)
-      case $ac_arg in
-      *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
-      esac
-      as_fn_append ac_sub_configure_args " '$ac_arg'" ;;
-    esac
-  done
-
-  # Always prepend --prefix to ensure using the same prefix
-  # in subdir configurations.
-  ac_arg="--prefix=$prefix"
-  case $ac_arg in
-  *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
-  esac
-  ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"
-
-  # Pass --silent
-  if test "$silent" = yes; then
-    ac_sub_configure_args="--silent $ac_sub_configure_args"
-  fi
-
-  # Always prepend --disable-option-checking to silence warnings, since
-  # different subdirs can have different --enable and --with options.
-  ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args"
-
-  ac_popdir=`pwd`
-  for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
-
-    # Do not complain, so a configure script can configure whichever
-    # parts of a large source tree are present.
-    test -d "$srcdir/$ac_dir" || continue
-
-    ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)"
-    $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5
-    $as_echo "$ac_msg" >&6
-    as_dir="$ac_dir"; as_fn_mkdir_p
-    ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
-  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
-  # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
-  case $ac_top_builddir_sub in
-  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
-  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
-  esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
-  .)  # We are building in place.
-    ac_srcdir=.
-    ac_top_srcdir=$ac_top_builddir_sub
-    ac_abs_top_srcdir=$ac_pwd ;;
-  [\\/]* | ?:[\\/]* )  # Absolute name.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir
-    ac_abs_top_srcdir=$srcdir ;;
-  *) # Relative name.
-    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_build_prefix$srcdir
-    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
-    cd "$ac_dir"
-
-    # Check for guested configure; otherwise get Cygnus style configure.
-    if test -f "$ac_srcdir/configure.gnu"; then
-      ac_sub_configure=$ac_srcdir/configure.gnu
-    elif test -f "$ac_srcdir/configure"; then
-      ac_sub_configure=$ac_srcdir/configure
-    elif test -f "$ac_srcdir/configure.in"; then
-      # This should be Cygnus configure.
-      ac_sub_configure=$ac_aux_dir/configure
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5
-$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
-      ac_sub_configure=
-    fi
-
-    # The recursion is here.
-    if test -n "$ac_sub_configure"; then
-      # Make the cache file name correct relative to the subdirectory.
-      case $cache_file in
-      [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;;
-      *) # Relative name.
-	ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
-      esac
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
-$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
-      # The eval makes quoting arguments work.
-      eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
-	   --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
-	as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5
-    fi
-
-    cd "$ac_popdir"
-  done
-fi
 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
diff --git a/sim/testsuite/configure.ac b/sim/testsuite/configure.ac
index e878371fd98b..140eb7d5a762 100644
--- a/sim/testsuite/configure.ac
+++ b/sim/testsuite/configure.ac
@@ -11,13 +11,6 @@ AC_SUBST(CC)
 AC_CONFIG_AUX_DIR(../..)
 AC_CANONICAL_SYSTEM
 
-# Configure sub-directory for appropriate targets
-case ${target} in
-    d10v-*-elf )
-	AC_CONFIG_SUBDIRS(d10v-elf)
-	;;
-esac
-
 sinclude(../configure.tgt)
 
 AC_OUTPUT(Makefile)
diff --git a/sim/testsuite/d10v-elf/Makefile.in b/sim/testsuite/d10v-elf/Makefile.in
deleted file mode 100644
index 938085e4ed58..000000000000
--- a/sim/testsuite/d10v-elf/Makefile.in
+++ /dev/null
@@ -1,180 +0,0 @@
-# Makefile for regression testing the GNU debugger.
-# Copyright (C) 1992-2021 Free Software Foundation, Inc.
-
-# This file is part of GDB.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-VPATH = @srcdir@
-srcdir = @srcdir@
-srcroot = $(srcdir)/..
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-host_alias = @host_alias@
-target_alias = @target_alias@
-program_transform_name = @program_transform_name@
-build_canonical = @build@
-host_canonical = @host@
-target_canonical = @target@
-target_cpu = @target_cpu@
-
-
-SHELL = /bin/sh
-SUBDIRS = @subdirs@
-RPATH_ENVVAR = @RPATH_ENVVAR@
-
-TESTS = \
-	exit47.ko \
-	hello.hi \
-	t-dbt.ok \
-	t-ld-st.ok \
-	t-mac.ok \
-	t-mvtac.ok \
-	t-mvtc.ok \
-	t-msbu.ok \
-	t-mulxu.ok \
-	t-rac.ok \
-	t-rachi.ok \
-	t-rdt.ok \
-	t-rep.ok \
-	t-rte.ok \
-	t-sac.ok \
-	t-sachi.ok \
-	t-sadd.ok \
-	t-slae.ok \
-	t-sp.ok \
-	t-sub2w.ok \
-	t-sub.ok \
-	t-subi.ok \
-	t-ae-ld-d.ok \
-	t-ae-ld-i.ok \
-	t-ae-ld-id.ok \
-	t-ae-ld-im.ok \
-	t-ae-ld-ip.ok \
-	t-ae-ld2w-d.ok \
-	t-ae-ld2w-i.ok \
-	t-ae-ld2w-id.ok \
-	t-ae-ld2w-im.ok \
-	t-ae-ld2w-ip.ok \
-	t-ae-st-d.ok \
-	t-ae-st-i.ok \
-	t-ae-st-id.ok \
-	t-ae-st-im.ok \
-	t-ae-st-ip.ok \
-	t-ae-st-is.ok \
-	t-ae-st2w-d.ok \
-	t-ae-st2w-i.ok \
-	t-ae-st2w-id.ok \
-	t-ae-st2w-im.ok \
-	t-ae-st2w-ip.ok \
-	t-ae-st2w-is.ok \
-	t-mod-ld-pre.ok \
-	t-rie-xx.ok \
-#
-
-AS_FOR_TARGET = `\
-  if [ -x ../../../gas/as-new ]; then \
-    echo ../../../gas/as-new ; \
-  else \
-    echo $(target_alias)-as ; \
-  fi`
-
-LD_FOR_TARGET = `\
-  if [ -x ../../../ld/ld-new ]; then \
-    echo ../../../ld/ld-new ; \
-  else \
-    echo $(target_alias)-ld ; \
-  fi`
-
-RUN_FOR_TARGET = `\
-  if [ -x ../../../sim/d10v/run ]; then \
-    echo ../../../sim/d10v/run ; \
-  else \
-    echo $(target_alias)-run ; \
-  fi`
-
-# Force d10v into operating mode.
-RUNFLAGS_FOR_TARGET=--environment operating
-
-
-check: sanity $(TESTS)
-sanity:
-	@eval echo AS_FOR_TARGET=$(AS_FOR_TARGET)
-	@eval echo LD_FOR_TARGET=$(LD_FOR_TARGET)
-	@eval echo RUN_FOR_TARGET=$(RUN_FOR_TARGET)
-
-clean:
-	rm -f $(TESTS)
-	rm -f *.run *.o
-	rm -f core *.core
-
-# Rules for running the tests
-
-.SUFFIXES: .ok .run .hi .ko .ti
-.run.ok:
-	rm -f tmp-$* $*.hi
-	ulimit -t 5 ; \
-	$(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$*
-	mv tmp-$* $*.ok
-.run.hi:
-	rm -f tmp-$* $*.hi diff-$*
-	ulimit -t 5 ; \
-	$(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$*
-	echo 'Hello World!' | diff - tmp-$* > diff-$*
-	cat tmp-$* diff-$* > $*.hi
-.run.ko:
-	rm -f tmp-$* $*.ko
-	set +e ; \
-	ulimit -t 5 ; \
-	$(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$* ; \
-	if [ $$? -eq 47 ] ; then \
-	  exit 0 ; \
-	else \
-	  exit 1 ; \
-	fi
-	mv tmp-$* $*.ko
-.run.ti:
-	rm -f tmp-$* $*.ti
-	set +e ; \
-	ulimit -t 5 ; \
-	$(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $(INTFLAGS_FOR_TARGET) $*.run > tmp-$*
-	test `cat tmp-$* | wc -l` -eq 10 < /dev/null
-	test `grep Tick tmp-$* | wc -l` -eq 10 < /dev/null
-	mv tmp-$* $*.ti
-
-
-# Rules for building the test
-# Preference is for obtaining the executable (.run) from a prebuilt image
-
-.SUFFIXES: .uue .s .S .run
-.uue.run:
-	head $* | grep $*.run > /dev/null
-	uudecode $*.uue
-.run.u:
-	uuencode < $*.run $*.run > $*.u
-.o.run:
-	$(LD_FOR_TARGET) $(LDFLAGS_FOR_TARGET) -o $*.run $*.o
-.s.o:
-	$(AS_FOR_TARGET) $(ASFLAGS_FOR_TARGET) -I$(srcdir) $(srcdir)/$*.s -o $*.o
-.S.o:
-	$(AS_FOR_TARGET) $(ASFLAGS_FOR_TARGET) -I$(srcdir) $(srcdir)/$*.S -o $*.o
-
-
-Makefile: Makefile.in config.status
-	$(SHELL) ./config.status
-
-config.status: configure
-	$(SHELL) ./config.status --recheck
diff --git a/sim/testsuite/d10v-elf/configure b/sim/testsuite/d10v-elf/configure
deleted file mode 100755
index 5686b7e4eb2c..000000000000
--- a/sim/testsuite/d10v-elf/configure
+++ /dev/null
diff --git a/sim/testsuite/d10v-elf/configure.ac b/sim/testsuite/d10v-elf/configure.ac
deleted file mode 100644
index 278d84d0e825..000000000000
--- a/sim/testsuite/d10v-elf/configure.ac
+++ /dev/null
@@ -1,18 +0,0 @@
-dnl Process this file file with autoconf to produce a configure script.
-dnl This file is a shell script fragment that supplies the information
-dnl necessary to tailor a template configure script into the configure
-dnl script appropriate for this directory.  For more information, check
-dnl any existing configure script.
-
-dnl FIXME - think of a truly uniq file to this directory
-AC_INIT(Makefile.in)
-
-CC=${CC-cc}
-AC_SUBST(CC)
-AC_CONFIG_AUX_DIR(../../..)
-AC_CANONICAL_SYSTEM
-
-AC_SUBST(target_cpu)
-
-
-AC_OUTPUT(Makefile)
diff --git a/sim/testsuite/d10v-elf/exit47.s b/sim/testsuite/d10v-elf/exit47.s
deleted file mode 100644
index 93e466465e2e..000000000000
--- a/sim/testsuite/d10v-elf/exit47.s
+++ /dev/null
@@ -1,4 +0,0 @@
-.include "t-macros.i"
-
-	start
-	exit47
diff --git a/sim/testsuite/d10v-elf/loop.s b/sim/testsuite/d10v-elf/loop.s
deleted file mode 100644
index e1371e4d9511..000000000000
--- a/sim/testsuite/d10v-elf/loop.s
+++ /dev/null
@@ -1,6 +0,0 @@
-	.text
-	.globl _start
-
-_start:
-	bra _start
-	nop
diff --git a/sim/testsuite/d10v-elf/ChangeLog b/sim/testsuite/sim/d10v/ChangeLog
similarity index 96%
rename from sim/testsuite/d10v-elf/ChangeLog
rename to sim/testsuite/sim/d10v/ChangeLog
index fec87674b14b..8915f76d7bd4 100644
--- a/sim/testsuite/d10v-elf/ChangeLog
+++ b/sim/testsuite/sim/d10v/ChangeLog
@@ -1,3 +1,8 @@
+2021-01-05  Mike Frysinger  <vapier@gentoo.org>
+
+	* allinsn.exp: New file.
+	* configure, configure.ac, loop.s, Makefile.in: Deleted.
+
 2020-10-06  Andrew Burgess  <andrew.burgess@embecosm.com>
 
 	* configure: Regnerate.
diff --git a/sim/testsuite/sim/d10v/allinsn.exp b/sim/testsuite/sim/d10v/allinsn.exp
new file mode 100644
index 000000000000..123509a3b990
--- /dev/null
+++ b/sim/testsuite/sim/d10v/allinsn.exp
@@ -0,0 +1,17 @@
+# d10v simulator testsuite.
+
+if [istarget d10v*-*] {
+    # load support procs (none yet)
+    # load_lib cgen.exp
+    # all machines
+    set all_machs "d10v"
+
+    foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.s]] {
+	# If we're only testing specific files and this isn't one of them,
+	# skip it.
+	if ![runtest_file_p $runtests $src] {
+	    continue
+	}
+	run_sim_test $src $all_machs
+    }
+}
diff --git a/sim/testsuite/d10v-elf/t-trap.s b/sim/testsuite/sim/d10v/exit47.s
similarity index 52%
rename from sim/testsuite/d10v-elf/t-trap.s
rename to sim/testsuite/sim/d10v/exit47.s
index 6ac4ae01ef8e..8f2a6ee8003c 100644
--- a/sim/testsuite/d10v-elf/t-trap.s
+++ b/sim/testsuite/sim/d10v/exit47.s
@@ -1,5 +1,8 @@
+# mach: all
+# status: 47
+# output:
+
 .include "t-macros.i"
 
 	start
-
 	exit47
diff --git a/sim/testsuite/d10v-elf/hello.s b/sim/testsuite/sim/d10v/hello.s
similarity index 54%
rename from sim/testsuite/d10v-elf/hello.s
rename to sim/testsuite/sim/d10v/hello.s
index d060c89adb0f..3e3557d7eb82 100644
--- a/sim/testsuite/d10v-elf/hello.s
+++ b/sim/testsuite/sim/d10v/hello.s
@@ -1,3 +1,6 @@
+# mach: all
+# output: Hello World!\n
+
 	.include "t-macros.i"
 
 	start
diff --git a/sim/testsuite/d10v-elf/t-ae-ld-d.s b/sim/testsuite/sim/d10v/t-ae-ld-d.s
similarity index 76%
rename from sim/testsuite/d10v-elf/t-ae-ld-d.s
rename to sim/testsuite/sim/d10v/t-ae-ld-d.s
index 1be783fe9846..511fbb072cf2 100644
--- a/sim/testsuite/d10v-elf/t-ae-ld-d.s
+++ b/sim/testsuite/sim/d10v/t-ae-ld-d.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_ld
-	
+
 	ld r8,@0x4000
 test_ld:
 	ld r8,@0x4001
diff --git a/sim/testsuite/d10v-elf/t-ae-ld-i.s b/sim/testsuite/sim/d10v/t-ae-ld-i.s
similarity index 79%
rename from sim/testsuite/d10v-elf/t-ae-ld-i.s
rename to sim/testsuite/sim/d10v/t-ae-ld-i.s
index 42168e1d812c..b9d10d161404 100644
--- a/sim/testsuite/d10v-elf/t-ae-ld-i.s
+++ b/sim/testsuite/sim/d10v/t-ae-ld-i.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_ld
-	
+
 	ldi r10, #0x4000
 	ld r8, @r10
 
diff --git a/sim/testsuite/d10v-elf/t-ae-ld-id.s b/sim/testsuite/sim/d10v/t-ae-ld-id.s
similarity index 78%
rename from sim/testsuite/d10v-elf/t-ae-ld-id.s
rename to sim/testsuite/sim/d10v/t-ae-ld-id.s
index 86b738235560..ed86525d213d 100644
--- a/sim/testsuite/d10v-elf/t-ae-ld-id.s
+++ b/sim/testsuite/sim/d10v/t-ae-ld-id.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_ld
-	
+
 	ldi r10, #0x4001
 	ld r8, @(1,r10)
 
diff --git a/sim/testsuite/d10v-elf/t-ae-ld-im.s b/sim/testsuite/sim/d10v/t-ae-ld-im.s
similarity index 79%
rename from sim/testsuite/d10v-elf/t-ae-ld-im.s
rename to sim/testsuite/sim/d10v/t-ae-ld-im.s
index 08e2ba6d38e3..42f87161876e 100644
--- a/sim/testsuite/d10v-elf/t-ae-ld-im.s
+++ b/sim/testsuite/sim/d10v/t-ae-ld-im.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_ld
-	
+
 	ldi r10, #0x4000
 	ld r8, @r10-
 
diff --git a/sim/testsuite/d10v-elf/t-ae-ld-ip.s b/sim/testsuite/sim/d10v/t-ae-ld-ip.s
similarity index 79%
rename from sim/testsuite/d10v-elf/t-ae-ld-ip.s
rename to sim/testsuite/sim/d10v/t-ae-ld-ip.s
index cad66600804f..c163912ce5b6 100644
--- a/sim/testsuite/d10v-elf/t-ae-ld-ip.s
+++ b/sim/testsuite/sim/d10v/t-ae-ld-ip.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_ld
-	
+
 	ldi r10, #0x4000
 	ld r8, @r10+
 
diff --git a/sim/testsuite/d10v-elf/t-ae-ld2w-d.s b/sim/testsuite/sim/d10v/t-ae-ld2w-d.s
similarity index 77%
rename from sim/testsuite/d10v-elf/t-ae-ld2w-d.s
rename to sim/testsuite/sim/d10v/t-ae-ld2w-d.s
index c8254ab191f8..1c81594f7ab2 100644
--- a/sim/testsuite/d10v-elf/t-ae-ld2w-d.s
+++ b/sim/testsuite/sim/d10v/t-ae-ld2w-d.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_ld2w
-	
+
 	ld2w r8,@0x4000
 test_ld2w:
 	ld2w r8,@0x4001
diff --git a/sim/testsuite/d10v-elf/t-ae-ld2w-i.s b/sim/testsuite/sim/d10v/t-ae-ld2w-i.s
similarity index 80%
rename from sim/testsuite/d10v-elf/t-ae-ld2w-i.s
rename to sim/testsuite/sim/d10v/t-ae-ld2w-i.s
index 4b32df5cc320..9547870fa43a 100644
--- a/sim/testsuite/d10v-elf/t-ae-ld2w-i.s
+++ b/sim/testsuite/sim/d10v/t-ae-ld2w-i.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_ld2w
-	
+
 	ldi r10, #0x4000
 	ld2w r8, @r10
 
diff --git a/sim/testsuite/d10v-elf/t-ae-ld2w-id.s b/sim/testsuite/sim/d10v/t-ae-ld2w-id.s
similarity index 79%
rename from sim/testsuite/d10v-elf/t-ae-ld2w-id.s
rename to sim/testsuite/sim/d10v/t-ae-ld2w-id.s
index 906b2a0836e5..2766388f1884 100644
--- a/sim/testsuite/d10v-elf/t-ae-ld2w-id.s
+++ b/sim/testsuite/sim/d10v/t-ae-ld2w-id.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_ld2w
-	
+
 	ldi r10, #0x4001
 	ld2w r8,@(1,r10)
 test_ld2w:
diff --git a/sim/testsuite/d10v-elf/t-ae-ld2w-im.s b/sim/testsuite/sim/d10v/t-ae-ld2w-im.s
similarity index 80%
rename from sim/testsuite/d10v-elf/t-ae-ld2w-im.s
rename to sim/testsuite/sim/d10v/t-ae-ld2w-im.s
index 71a7286dfcd0..c6946f3a998f 100644
--- a/sim/testsuite/d10v-elf/t-ae-ld2w-im.s
+++ b/sim/testsuite/sim/d10v/t-ae-ld2w-im.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_ld2w
-	
+
 	ldi r10, #0x4000
 	ld2w r8, @r10-
 
diff --git a/sim/testsuite/d10v-elf/t-ae-ld2w-ip.s b/sim/testsuite/sim/d10v/t-ae-ld2w-ip.s
similarity index 80%
rename from sim/testsuite/d10v-elf/t-ae-ld2w-ip.s
rename to sim/testsuite/sim/d10v/t-ae-ld2w-ip.s
index 38cfab622b14..6214853d7d51 100644
--- a/sim/testsuite/d10v-elf/t-ae-ld2w-ip.s
+++ b/sim/testsuite/sim/d10v/t-ae-ld2w-ip.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_ld2w
-	
+
 	ldi r10, #0x4000
 	ld2w r8, @r10+
 
diff --git a/sim/testsuite/d10v-elf/t-ae-st-d.s b/sim/testsuite/sim/d10v/t-ae-st-d.s
similarity index 76%
rename from sim/testsuite/d10v-elf/t-ae-st-d.s
rename to sim/testsuite/sim/d10v/t-ae-st-d.s
index 1f0edd87f25e..99bd724b5d15 100644
--- a/sim/testsuite/d10v-elf/t-ae-st-d.s
+++ b/sim/testsuite/sim/d10v/t-ae-st-d.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_st
-	
+
 	st r8,@0x4000
 test_st:
 	st r8,@0x4001
diff --git a/sim/testsuite/d10v-elf/t-ae-st-i.s b/sim/testsuite/sim/d10v/t-ae-st-i.s
similarity index 79%
rename from sim/testsuite/d10v-elf/t-ae-st-i.s
rename to sim/testsuite/sim/d10v/t-ae-st-i.s
index 15245981ecfd..5f0f9b44c419 100644
--- a/sim/testsuite/d10v-elf/t-ae-st-i.s
+++ b/sim/testsuite/sim/d10v/t-ae-st-i.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_st
-	
+
 	ldi r10,#0x4000
 	st r8, @r10
 
diff --git a/sim/testsuite/d10v-elf/t-ae-st-id.s b/sim/testsuite/sim/d10v/t-ae-st-id.s
similarity index 78%
rename from sim/testsuite/d10v-elf/t-ae-st-id.s
rename to sim/testsuite/sim/d10v/t-ae-st-id.s
index 4caa1b4fafcf..9620fce1a0b8 100644
--- a/sim/testsuite/d10v-elf/t-ae-st-id.s
+++ b/sim/testsuite/sim/d10v/t-ae-st-id.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_st
-	
+
 	ldi r10,#0x4001
 	st r8, @(1,r10)
 test_st:
diff --git a/sim/testsuite/d10v-elf/t-ae-st-im.s b/sim/testsuite/sim/d10v/t-ae-st-im.s
similarity index 79%
rename from sim/testsuite/d10v-elf/t-ae-st-im.s
rename to sim/testsuite/sim/d10v/t-ae-st-im.s
index d4c8bafe0967..0318243a8d41 100644
--- a/sim/testsuite/d10v-elf/t-ae-st-im.s
+++ b/sim/testsuite/sim/d10v/t-ae-st-im.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_st
-	
+
 	ldi r10,#0x4000
 	st r8, @r10-
 
diff --git a/sim/testsuite/d10v-elf/t-ae-st-ip.s b/sim/testsuite/sim/d10v/t-ae-st-ip.s
similarity index 79%
rename from sim/testsuite/d10v-elf/t-ae-st-ip.s
rename to sim/testsuite/sim/d10v/t-ae-st-ip.s
index e3a02ee528d3..78d9a1d79940 100644
--- a/sim/testsuite/d10v-elf/t-ae-st-ip.s
+++ b/sim/testsuite/sim/d10v/t-ae-st-ip.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_st
-	
+
 	ldi r10,#0x4000
 	st r8, @r10+
 
diff --git a/sim/testsuite/d10v-elf/t-ae-st-is.s b/sim/testsuite/sim/d10v/t-ae-st-is.s
similarity index 79%
rename from sim/testsuite/d10v-elf/t-ae-st-is.s
rename to sim/testsuite/sim/d10v/t-ae-st-is.s
index 4868780128c1..08e1d7e5f3da 100644
--- a/sim/testsuite/d10v-elf/t-ae-st-is.s
+++ b/sim/testsuite/sim/d10v/t-ae-st-is.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_st
-	
+
 	ldi sp,#0x4000
 	st r8, @-SP
 
diff --git a/sim/testsuite/d10v-elf/t-ae-st2w-d.s b/sim/testsuite/sim/d10v/t-ae-st2w-d.s
similarity index 77%
rename from sim/testsuite/d10v-elf/t-ae-st2w-d.s
rename to sim/testsuite/sim/d10v/t-ae-st2w-d.s
index a0d9c3176e9b..6f07a9975819 100644
--- a/sim/testsuite/d10v-elf/t-ae-st2w-d.s
+++ b/sim/testsuite/sim/d10v/t-ae-st2w-d.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_st2w
-	
+
 	st2w r8,@0x4000
 test_st2w:
 	st2w r8,@0x4001
diff --git a/sim/testsuite/d10v-elf/t-ae-st2w-i.s b/sim/testsuite/sim/d10v/t-ae-st2w-i.s
similarity index 80%
rename from sim/testsuite/d10v-elf/t-ae-st2w-i.s
rename to sim/testsuite/sim/d10v/t-ae-st2w-i.s
index 8c24bc92d75c..a629b759715c 100644
--- a/sim/testsuite/d10v-elf/t-ae-st2w-i.s
+++ b/sim/testsuite/sim/d10v/t-ae-st2w-i.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_st2w
-	
+
 	ldi r10, #0x4000
 	st2w r8, @r10
 
diff --git a/sim/testsuite/d10v-elf/t-ae-st2w-id.s b/sim/testsuite/sim/d10v/t-ae-st2w-id.s
similarity index 79%
rename from sim/testsuite/d10v-elf/t-ae-st2w-id.s
rename to sim/testsuite/sim/d10v/t-ae-st2w-id.s
index bfbfd4dd69df..91f231978d0a 100644
--- a/sim/testsuite/d10v-elf/t-ae-st2w-id.s
+++ b/sim/testsuite/sim/d10v/t-ae-st2w-id.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_st2w
-	
+
 	ldi r10, #0x4001
 	st2w r8, @(1,r10)
 test_st2w:
diff --git a/sim/testsuite/d10v-elf/t-ae-st2w-im.s b/sim/testsuite/sim/d10v/t-ae-st2w-im.s
similarity index 80%
rename from sim/testsuite/d10v-elf/t-ae-st2w-im.s
rename to sim/testsuite/sim/d10v/t-ae-st2w-im.s
index ee0a9ebe10a8..f8cc7fb45fbf 100644
--- a/sim/testsuite/d10v-elf/t-ae-st2w-im.s
+++ b/sim/testsuite/sim/d10v/t-ae-st2w-im.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_st2w
-	
+
 	ldi r10, #0x4000
 	st2w r8, @r10-
 
diff --git a/sim/testsuite/d10v-elf/t-ae-st2w-ip.s b/sim/testsuite/sim/d10v/t-ae-st2w-ip.s
similarity index 80%
rename from sim/testsuite/d10v-elf/t-ae-st2w-ip.s
rename to sim/testsuite/sim/d10v/t-ae-st2w-ip.s
index dc911f723fbb..63c5abd5bd08 100644
--- a/sim/testsuite/d10v-elf/t-ae-st2w-ip.s
+++ b/sim/testsuite/sim/d10v/t-ae-st2w-ip.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_st2w
-	
+
 	ldi r10, #0x4000
 	st2w r8, @r10+
 
diff --git a/sim/testsuite/d10v-elf/t-ae-st2w-is.s b/sim/testsuite/sim/d10v/t-ae-st2w-is.s
similarity index 79%
rename from sim/testsuite/d10v-elf/t-ae-st2w-is.s
rename to sim/testsuite/sim/d10v/t-ae-st2w-is.s
index e39d71ce4c08..190ab4223a02 100644
--- a/sim/testsuite/d10v-elf/t-ae-st2w-is.s
+++ b/sim/testsuite/sim/d10v/t-ae-st2w-is.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_AE&DMAP_MASK)+DMAP_BASE PSW_BITS test_st2w
-	
+
 	ldi sp, #0x4004
 	st2w r8, @-SP
 
diff --git a/sim/testsuite/d10v-elf/t-dbt.s b/sim/testsuite/sim/d10v/t-dbt.s
similarity index 88%
rename from sim/testsuite/d10v-elf/t-dbt.s
rename to sim/testsuite/sim/d10v/t-dbt.s
index 8c518475be7c..9b405b09c833 100644
--- a/sim/testsuite/d10v-elf/t-dbt.s
+++ b/sim/testsuite/sim/d10v/t-dbt.s
@@ -1,9 +1,14 @@
+# mach: all
+# output:
+# sim: --environment operating
+# as: -W
+
 .include "t-macros.i"
 
 	start
 
 	PSW_BITS = PSW_DM
-	
+
 ;;; Blat our DMAP registers so that they point at on-chip imem
 
 	ldi r2, MAP_INSN | 0xf
diff --git a/sim/testsuite/d10v-elf/t-ld-st.s b/sim/testsuite/sim/d10v/t-ld-st.s
similarity index 88%
rename from sim/testsuite/d10v-elf/t-ld-st.s
rename to sim/testsuite/sim/d10v/t-ld-st.s
index ec9f2023f6ae..4ae4f852e56a 100644
--- a/sim/testsuite/d10v-elf/t-ld-st.s
+++ b/sim/testsuite/sim/d10v/t-ld-st.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
diff --git a/sim/testsuite/d10v-elf/t-mac.s b/sim/testsuite/sim/d10v/t-mac.s
similarity index 95%
rename from sim/testsuite/d10v-elf/t-mac.s
rename to sim/testsuite/sim/d10v/t-mac.s
index 364f61531d14..1b6e660c5364 100644
--- a/sim/testsuite/d10v-elf/t-mac.s
+++ b/sim/testsuite/sim/d10v/t-mac.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -22,7 +26,7 @@ test_macu2:
 
 
 
-	
+
 	;; clear FX
 	ldi r2, #0x8005
 	mvtc r2, cr0
diff --git a/sim/testsuite/d10v-elf/t-macros.i b/sim/testsuite/sim/d10v/t-macros.i
similarity index 97%
rename from sim/testsuite/d10v-elf/t-macros.i
rename to sim/testsuite/sim/d10v/t-macros.i
index f424acfa57b7..d6e155ce232f 100644
--- a/sim/testsuite/d10v-elf/t-macros.i
+++ b/sim/testsuite/sim/d10v/t-macros.i
@@ -1,3 +1,7 @@
+# mach: d10v
+# output:
+# sim: --environment operating
+
 	.macro start
 	.text
 	.align 2
@@ -158,12 +162,12 @@ _start:
 	.text
 	ldi r4, #1f
 	ldi r5, \vec
-	;; 	
+	;;
 	ld2w r2, @(0,r4)
 	st2w r2, @(0,r5)
 	ld2w r2, @(4,r4)
 	st2w r2, @(4,r5)
-	;; 	
+	;;
 	bra 9f
 	nop
 ;;; Code that gets patched into the interrupt vector
@@ -185,7 +189,7 @@ _start:
 	exit2
 4:	exit0
 ;;; continue as normal
-9:	
+9:
 	.endm
 
 
@@ -229,5 +233,3 @@ _start:
 	VEC_SDBT = 0x3fff4
 	VEC_DBI  = 0x3ff58
 	VEC_EI   = 0x3ff5c
-
-
diff --git a/sim/testsuite/d10v-elf/t-mod-ld-pre.s b/sim/testsuite/sim/d10v/t-mod-ld-pre.s
similarity index 90%
rename from sim/testsuite/d10v-elf/t-mod-ld-pre.s
rename to sim/testsuite/sim/d10v/t-mod-ld-pre.s
index 4536e0344e1a..7d75af2b877c 100644
--- a/sim/testsuite/d10v-elf/t-mod-ld-pre.s
+++ b/sim/testsuite/sim/d10v/t-mod-ld-pre.s
@@ -1,15 +1,15 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
-.section        .rodata
- 
-        .text
-        .globl  main
-        .type   main,@function
-main:
+    start
+
     mvfc        r0, PSW             ||  ldi.s       r14, #0
     ldi.l       r2, 0x100               ; MOD_E
     ldi.l       r3, 0x108               ; MOD_S
- 
+
 test_mod_dec_ld:
     mvtc        r2, MOD_E           ||  bseti       r0, #7
     mvtc        r3, MOD_S
@@ -19,12 +19,12 @@ test_mod_dec_ld:
     ld          r4, @r1-        ||      nop     ; r1=0x104
     ld          r4, @r1-        ||      nop     ; r1=0x102
     ld          r4, @r1-        ||      nop     ; r1=0x100
-    ld          r4, @r1-        ||      nop     ; r1=0x108 
-    ld          r4, @r1-        ||      nop     ; r1=0x106 
- 
+    ld          r4, @r1-        ||      nop     ; r1=0x108
+    ld          r4, @r1-        ||      nop     ; r1=0x106
+
     cmpeqi      r1,#0x106
     brf0f       _ERR            ;  branch to error
- 
+
 test_mod_inc_ld:
     mvtc        r2, MOD_S
     mvtc        r3, MOD_E
@@ -35,22 +35,22 @@ test_mod_inc_ld:
     ld          r4, @r1+        ||      nop     ; r1=0x108
     ld          r4, @r1+        ||      nop     ; r1=0x100
     ld          r4, @r1+        ||      nop     ; r1=0x102
- 
+
     cmpeqi      r1,#0x102
     brf0f       _ERR
- 
+
 test_mod_dec_ld2w:
     mvtc        r2, MOD_E
     mvtc        r3, MOD_S
     mv          r1,r3                           ; r1=0x108
     ld2W        r4, @r1-        ||      nop     ; r1=0x104
     ld2W        r4, @r1-        ||      nop     ; r1=0x100
-    ld2W        r4, @r1-        ||      nop     ; r1=0x108 
-    ld2W        r4, @r1-        ||      nop     ; r1=0x104 
- 
+    ld2W        r4, @r1-        ||      nop     ; r1=0x108
+    ld2W        r4, @r1-        ||      nop     ; r1=0x104
+
     cmpeqi      r1,#0x104
     brf0f       _ERR            ; <= branch to error
- 
+
 test_mod_inc_ld2w:
     mvtc        r2, MOD_S
     mvtc        r3, MOD_E           ||  BCLRI       r0, #7
@@ -59,10 +59,10 @@ test_mod_inc_ld2w:
     ld2W        r4, @r1+        ||      nop     ; r1=0x108
     ld2W        r4, @r1+        ||      nop     ; r1=0x100
     ld2W        r4, @r1+        ||      nop     ; r1=0x104
- 
+
     cmpeqi      r1,#0x104
     brf0f       _ERR
- 
+
 test_mod_dec_ld_dis:
     mvtc        r0, PSW                 ; modulo mode disable
     mvtc        r2, MOD_E
@@ -74,10 +74,10 @@ test_mod_dec_ld_dis:
     ld          r4, @r1-        ||      nop     ; r1=0x100
     ld          r4, @r1-        ||      nop     ; r1=0xFE
     ld          r4, @r1-        ||      nop     ; r1=0xFC
- 
+
     cmpeqi      r1,#0xFC
     brf0f       _ERR
- 
+
 test_mod_inc_ld_dis:
     mvtc        r2, MOD_S
     mvtc        r3, MOD_E
@@ -88,10 +88,10 @@ test_mod_inc_ld_dis:
     ld          r4, @r1+        ||      nop     ; r1=0x108
     ld          r4, @r1+        ||      nop     ; r1=0x10A
     ld          r4, @r1+        ||      nop     ; r1=0x10C
- 
+
     cmpeqi      r1,#0x10C
     brf0f       _ERR
- 
+
 test_mod_dec_ld2w_dis:
     mvtc        r2, MOD_E
     mvtc        r3, MOD_S
@@ -100,7 +100,7 @@ test_mod_dec_ld2w_dis:
     ld2W        r4, @r1-        ||      nop     ; r1=0x100
     ld2W        r4, @r1-        ||      nop     ; r1=0xFC
     ld2W        r4, @r1-        ||      nop     ; r1=0xF8
- 
+
     cmpeqi      r1,#0xF8
     brf0f       _ERR
 
@@ -112,15 +112,15 @@ test_mod_dec_ld2w_dis:
     ld2W        r4, @r1+        ||      nop     ; r1=0x108
     ld2W        r4, @r1+        ||      nop     ; r1=0x10C
     ld2W        r4, @r1+        ||      nop     ; r1=0x110
- 
+
     cmpeqi      r1,#0x110
-    brf0f       _ERR 
+    brf0f       _ERR
 
 _OK:
 	exit0
- 
+
 _ERR:
 	exit47
 
- 
+
 
diff --git a/sim/testsuite/d10v-elf/t-msbu.s b/sim/testsuite/sim/d10v/t-msbu.s
similarity index 87%
rename from sim/testsuite/d10v-elf/t-msbu.s
rename to sim/testsuite/sim/d10v/t-msbu.s
index 04276cc25d95..93b65a539798 100644
--- a/sim/testsuite/d10v-elf/t-msbu.s
+++ b/sim/testsuite/sim/d10v/t-msbu.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -13,7 +17,7 @@ test_msbu1:
 	MSBU a1, r9, r8
 	checkacc2 1 a1 0X7F 0x7FFF 0x8000
 
-	
+
 	;; set FX
 	ldi r2, #0x8085
 	mvtc r2, cr0
diff --git a/sim/testsuite/d10v-elf/t-mulxu.s b/sim/testsuite/sim/d10v/t-mulxu.s
similarity index 87%
rename from sim/testsuite/d10v-elf/t-mulxu.s
rename to sim/testsuite/sim/d10v/t-mulxu.s
index a8e6ffc8d49b..b0c14b6d6da2 100644
--- a/sim/testsuite/d10v-elf/t-mulxu.s
+++ b/sim/testsuite/sim/d10v/t-mulxu.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -13,7 +17,7 @@ test_mulxu1:
 	MULXU a1, r9, r8
 	checkacc2 1 a1 0x00 0x8000 0x7FFF
 
-	
+
 	;; set FX
 	ldi r2, #0x8085
 	mvtc r2, cr0
diff --git a/sim/testsuite/d10v-elf/t-mvtac.s b/sim/testsuite/sim/d10v/t-mvtac.s
similarity index 84%
rename from sim/testsuite/d10v-elf/t-mvtac.s
rename to sim/testsuite/sim/d10v/t-mvtac.s
index 68452dc827a2..dc73403192d5 100644
--- a/sim/testsuite/d10v-elf/t-mvtac.s
+++ b/sim/testsuite/sim/d10v/t-mvtac.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -8,7 +12,7 @@
 
 	mvtacg	r0, a0
 	checkacc2 2 a0 0x00 0xffff 0xbeef
-	
+
 	ldi r8, 0xdead
 	mvtachi	r8, a0
 	checkacc2 3 a0 0xff 0xdead 0xbeef
diff --git a/sim/testsuite/d10v-elf/t-mvtc.s b/sim/testsuite/sim/d10v/t-mvtc.s
similarity index 95%
rename from sim/testsuite/d10v-elf/t-mvtc.s
rename to sim/testsuite/sim/d10v/t-mvtc.s
index 2eed8331a405..0b463ae935f0 100644
--- a/sim/testsuite/d10v-elf/t-mvtc.s
+++ b/sim/testsuite/sim/d10v/t-mvtc.s
@@ -1,3 +1,8 @@
+# mach: all
+# output:
+# sim: --environment operating
+# as: -W
+
 .include "t-macros.i"
 
 	start
@@ -32,7 +37,7 @@
 	checkpsw2 9 PSW_FX|PSW_ST
 
 	;; loadpsw2 PSW_ST
-	;; checkpsw2 10 
+	;; checkpsw2 10
 
 	loadpsw2 PSW_10
 	checkpsw2 11 0 ;; PSW_10
@@ -59,7 +64,7 @@
 	mvtc	r6, cr10
 	ldi	r6, #0xbeef
 	mvtc	r6, cr11
-	
+
 	mvfc	r7, cr10
 	check 17 r7 0xdeac
 	mvfc	r7, cr11
diff --git a/sim/testsuite/d10v-elf/t-rac.s b/sim/testsuite/sim/d10v/t-rac.s
similarity index 82%
rename from sim/testsuite/d10v-elf/t-rac.s
rename to sim/testsuite/sim/d10v/t-rac.s
index f2123116c642..a452299d581c 100644
--- a/sim/testsuite/d10v-elf/t-rac.s
+++ b/sim/testsuite/sim/d10v/t-rac.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
diff --git a/sim/testsuite/d10v-elf/t-rachi.s b/sim/testsuite/sim/d10v/t-rachi.s
similarity index 87%
rename from sim/testsuite/d10v-elf/t-rachi.s
rename to sim/testsuite/sim/d10v/t-rachi.s
index ed901959469d..57589b5d96a4 100644
--- a/sim/testsuite/d10v-elf/t-rachi.s
+++ b/sim/testsuite/sim/d10v/t-rachi.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
diff --git a/sim/testsuite/d10v-elf/t-rdt.s b/sim/testsuite/sim/d10v/t-rdt.s
similarity index 75%
rename from sim/testsuite/d10v-elf/t-rdt.s
rename to sim/testsuite/sim/d10v/t-rdt.s
index 661b583bb130..947da8644d56 100644
--- a/sim/testsuite/d10v-elf/t-rdt.s
+++ b/sim/testsuite/sim/d10v/t-rdt.s
@@ -1,9 +1,14 @@
+# mach: all
+# output:
+# sim: --environment operating
+# as: -W
+
 .include "t-macros.i"
 
 	start
 
 	PSW_BITS = PSW_C|PSW_F0|PSW_F1
-	
+
 	ldi	r6, #success@word
 	mvtc	r6, dpc
 	ldi	r6, #PSW_BITS
diff --git a/sim/testsuite/d10v-elf/t-rep.s b/sim/testsuite/sim/d10v/t-rep.s
similarity index 90%
rename from sim/testsuite/d10v-elf/t-rep.s
rename to sim/testsuite/sim/d10v/t-rep.s
index cea3ea8251d8..433aff1e4ef5 100644
--- a/sim/testsuite/d10v-elf/t-rep.s
+++ b/sim/testsuite/sim/d10v/t-rep.s
@@ -1,12 +1,16 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
 
 
-	
+
 	;; Check that the instruction @REP_E is executed when it
 	;; is reached using a branch instruction
-	
+
 	ldi r2, 1
 test_rep_1:
 	rep	r2, end_rep_1
diff --git a/sim/testsuite/d10v-elf/t-rie-xx.s b/sim/testsuite/sim/d10v/t-rie-xx.s
similarity index 79%
rename from sim/testsuite/d10v-elf/t-rie-xx.s
rename to sim/testsuite/sim/d10v/t-rie-xx.s
index 2a6fcbdd6fc8..fa6b4fc383ac 100644
--- a/sim/testsuite/d10v-elf/t-rie-xx.s
+++ b/sim/testsuite/sim/d10v/t-rie-xx.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,7 +9,7 @@
 	PSW_BITS = 0
 	point_dmap_at_imem
 	check_interrupt (VEC_RIE&DMAP_MASK)+DMAP_BASE PSW_BITS test_rie_xx
-	
+
 test_rie_xx:
         .short 0xe120, 0x0000  ;; Example of RIE code
 	nop
diff --git a/sim/testsuite/d10v-elf/t-rte.s b/sim/testsuite/sim/d10v/t-rte.s
similarity index 78%
rename from sim/testsuite/d10v-elf/t-rte.s
rename to sim/testsuite/sim/d10v/t-rte.s
index 5ce31ddbf41a..392f11812f17 100644
--- a/sim/testsuite/d10v-elf/t-rte.s
+++ b/sim/testsuite/sim/d10v/t-rte.s
@@ -1,9 +1,13 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
 
 	PSW_BITS = PSW_C|PSW_F0|PSW_F1
-	
+
 	ldi	r6, #success@word
 	mvtc	r6, bpc
 	ldi	r6, #PSW_BITS
diff --git a/sim/testsuite/d10v-elf/t-sac.s b/sim/testsuite/sim/d10v/t-sac.s
similarity index 85%
rename from sim/testsuite/d10v-elf/t-sac.s
rename to sim/testsuite/sim/d10v/t-sac.s
index 7042be025b1d..84c31d74c3b4 100644
--- a/sim/testsuite/d10v-elf/t-sac.s
+++ b/sim/testsuite/sim/d10v/t-sac.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
diff --git a/sim/testsuite/d10v-elf/t-sachi.s b/sim/testsuite/sim/d10v/t-sachi.s
similarity index 83%
rename from sim/testsuite/d10v-elf/t-sachi.s
rename to sim/testsuite/sim/d10v/t-sachi.s
index 7774ee045588..b9ed0e71a014 100644
--- a/sim/testsuite/d10v-elf/t-sachi.s
+++ b/sim/testsuite/sim/d10v/t-sachi.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
diff --git a/sim/testsuite/d10v-elf/t-sadd.s b/sim/testsuite/sim/d10v/t-sadd.s
similarity index 92%
rename from sim/testsuite/d10v-elf/t-sadd.s
rename to sim/testsuite/sim/d10v/t-sadd.s
index f3e4ebe3da4a..fb463d917377 100644
--- a/sim/testsuite/d10v-elf/t-sadd.s
+++ b/sim/testsuite/sim/d10v/t-sadd.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -13,7 +17,7 @@
         checkacc2 1 a0 0x00 0x7fff 0xffff
         checkacc2 2 a1 0xff 0x8000 0x7fff
 
- ;; Test overflow 
+ ;; Test overflow
 
         loadacc2 a0 0x00 0x0000 0x0000
         loadacc2 a1 0x01 0x8000 0x0000
diff --git a/sim/testsuite/d10v-elf/t-slae.s b/sim/testsuite/sim/d10v/t-slae.s
similarity index 92%
rename from sim/testsuite/d10v-elf/t-slae.s
rename to sim/testsuite/sim/d10v/t-slae.s
index 6d8422d0f9f8..8236fa2fd774 100644
--- a/sim/testsuite/d10v-elf/t-slae.s
+++ b/sim/testsuite/sim/d10v/t-slae.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
diff --git a/sim/testsuite/d10v-elf/t-sp.s b/sim/testsuite/sim/d10v/t-sp.s
similarity index 78%
rename from sim/testsuite/d10v-elf/t-sp.s
rename to sim/testsuite/sim/d10v/t-sp.s
index 84f9ad486766..df443b904879 100644
--- a/sim/testsuite/d10v-elf/t-sp.s
+++ b/sim/testsuite/sim/d10v/t-sp.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -8,7 +12,7 @@
 	ldi sp, 0xdead
 	loadpsw2 PSW_SM
 	ldi sp, 0xbeef
-	
+
 	loadpsw2 0
 	check 1 sp 0xdead
 	loadpsw2 PSW_SM
diff --git a/sim/testsuite/d10v-elf/t-sub.s b/sim/testsuite/sim/d10v/t-sub.s
similarity index 92%
rename from sim/testsuite/d10v-elf/t-sub.s
rename to sim/testsuite/sim/d10v/t-sub.s
index 26d0a3a1c9ab..57b99e68efe3 100644
--- a/sim/testsuite/d10v-elf/t-sub.s
+++ b/sim/testsuite/sim/d10v/t-sub.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
diff --git a/sim/testsuite/d10v-elf/t-sub2w.s b/sim/testsuite/sim/d10v/t-sub2w.s
similarity index 93%
rename from sim/testsuite/d10v-elf/t-sub2w.s
rename to sim/testsuite/sim/d10v/t-sub2w.s
index 9f1bbb7321e8..5e8daee35186 100644
--- a/sim/testsuite/d10v-elf/t-sub2w.s
+++ b/sim/testsuite/sim/d10v/t-sub2w.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
@@ -5,11 +9,11 @@
 ;;  The d10v implements negated addition for subtraction
 
 	.macro check_sub2w s x y r c v
-	
+
 	;; clear carry
 	ldi	r6,#0x8004
 	mvtc	r6,cr0
-	
+
 	;; load opnds
 	ld2w	r6, @(1f,r0)
 	ld2w	r8, @(2f,r0)
@@ -17,10 +21,10 @@
 1:	.long	\x
 2:	.long	\y
 	.text
-	
+
 	;; subtract
 	SUB2W	r6, r8
-	
+
 	;; verify result
 	ld2w	r10, @(1f,r0)
 	.data
@@ -34,7 +38,7 @@
 	ldi	r0, \s
 	trap	15
 3:
-	
+
 	;; verify carry
 	mvfc	r6, cr0
 	and3	r6, r6, #1
@@ -45,7 +49,7 @@
 	trap	15
 1:
 	.endm
-	
+
 check_sub2w 1 0x00000000 0x00000000  0x00000000 1 0
 check_sub2w 2 0x00000000 0x00000001  0xffffffff 0 0
 check_sub2w 3 0x00000001 0x00000000  0x00000001 1 0
diff --git a/sim/testsuite/d10v-elf/t-subi.s b/sim/testsuite/sim/d10v/t-subi.s
similarity index 92%
rename from sim/testsuite/d10v-elf/t-subi.s
rename to sim/testsuite/sim/d10v/t-subi.s
index 81faad5ec24a..dd4b2be61a56 100644
--- a/sim/testsuite/d10v-elf/t-subi.s
+++ b/sim/testsuite/sim/d10v/t-subi.s
@@ -1,3 +1,7 @@
+# mach: all
+# output:
+# sim: --environment operating
+
 .include "t-macros.i"
 
 	start
diff --git a/sim/testsuite/sim/d10v/t-trap.s b/sim/testsuite/sim/d10v/t-trap.s
new file mode 100644
index 000000000000..7e5336cbdf64
--- /dev/null
+++ b/sim/testsuite/sim/d10v/t-trap.s
@@ -0,0 +1,10 @@
+# mach: all
+# status: 47
+# output:
+# sim: --environment operating
+
+.include "t-macros.i"
+
+	start
+
+	exit47
-- 
2.28.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] sim: testsuite: delete configure script
  2021-01-05  6:55 [PATCH 1/2] sim: testsuite: allow tests to declare expected exit status Mike Frysinger
                   ` (3 preceding siblings ...)
  2021-01-05  8:17 ` [PATCH] sim: d10v: relocate tests & clean up test harness Mike Frysinger
@ 2021-01-06  0:31 ` Mike Frysinger
  2021-01-11 23:34 ` [PATCH 1/2] sim: testsuite: allow tests to declare expected exit status Mike Frysinger
  5 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2021-01-06  0:31 UTC (permalink / raw)
  To: gdb-patches

Now that we've moved all ports to dejagnu & testsuite/sim/, the only
thing the testsuite/configure script has been doing is filling in the
sim_arch field in the testsuite/Makefile.  We can simply let the top
sim/configure script do that for us now.  This simplifies & speeds up
the build a bit by killing an entire configure script.
---
 sim/ChangeLog              |    7 +
 sim/configure              |   16 +-
 sim/configure.ac           |   16 +-
 sim/testsuite/ChangeLog    |    5 +
 sim/testsuite/Makefile.in  |    8 +-
 sim/testsuite/configure    | 3095 ------------------------------------
 sim/testsuite/configure.ac |   16 -
 7 files changed, 27 insertions(+), 3136 deletions(-)
 delete mode 100755 sim/testsuite/configure
 delete mode 100644 sim/testsuite/configure.ac

diff --git a/sim/ChangeLog b/sim/ChangeLog
index 047ff6ba0800..f2f77d8d1629 100644
--- a/sim/ChangeLog
+++ b/sim/ChangeLog
@@ -1,3 +1,10 @@
+2021-01-04  Mike Frysinger  <vapier@gentoo.org>
+
+	* configure.ac: Delete AC_CONFIG_SUBDIRS(testsuite) call.
+	Add AC_CONFIG_FILES([Makefile testsuite/Makefile]) call.
+	Drop argument to AC_OUTPUT.
+	* configure: Regenerate.
+
 2020-11-01  Simon Marchi  <simon.marchi@polymtl.ca>
 
 	* bpf/configure: Re-generate.
diff --git a/sim/configure b/sim/configure
index 34f1a15a4c63..26cd9a68d3d1 100755
--- a/sim/configure
+++ b/sim/configure
@@ -696,7 +696,6 @@ erc32
 ppc
 ft32
 v850
-testsuite
 igen'
 
 # Initialize some variables set by options.
@@ -3914,17 +3913,13 @@ subdirs="$subdirs aarch64"
 esac
 
 
-   if test x"${sim_arch}" != x; then
-      subdirs="$subdirs testsuite"
+  if test "$sim_igen" = yes; then
+    subdirs="$subdirs igen"
 
-      if test "$sim_igen" = yes; then
-         subdirs="$subdirs igen"
-
-      fi
-   fi
+  fi
 fi
 
-ac_config_files="$ac_config_files Makefile"
+ac_config_files="$ac_config_files Makefile testsuite/Makefile"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -4633,6 +4628,7 @@ for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
@@ -5232,5 +5228,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
-
-exit 0
diff --git a/sim/configure.ac b/sim/configure.ac
index d92ca25d3978..7de8b99888bf 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -42,15 +42,11 @@ m4_define([SIM_ARCH], [
   AC_CONFIG_SUBDIRS($1)
 ])
 if test "${enable_sim}" != no; then
-   sinclude(configure.tgt)
-   if test x"${sim_arch}" != x; then
-      AC_CONFIG_SUBDIRS(testsuite)
-      if test "$sim_igen" = yes; then
-         AC_CONFIG_SUBDIRS(igen)
-      fi
-   fi
+  sinclude(configure.tgt)
+  if test "$sim_igen" = yes; then
+    AC_CONFIG_SUBDIRS(igen)
+  fi
 fi
 
-AC_OUTPUT(Makefile)
-
-exit 0
+AC_CONFIG_FILES([Makefile testsuite/Makefile])
+AC_OUTPUT
diff --git a/sim/testsuite/ChangeLog b/sim/testsuite/ChangeLog
index 4e27a91c21ee..345147ff5b9f 100644
--- a/sim/testsuite/ChangeLog
+++ b/sim/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2021-01-05  Mike Frysinger  <vapier@gentoo.org>
+
+	* configure, configure.ac: Delete.
+	* Makefile.in (Makefile, config.status): Switch to ../config.status.
+
 2021-01-05  Mike Frysinger  <vapier@gentoo.org>
 
 	* configure.ac (target): Delete d10v-*-elf case.
diff --git a/sim/testsuite/Makefile.in b/sim/testsuite/Makefile.in
index d1ac988adf88..1f75db6a5539 100644
--- a/sim/testsuite/Makefile.in
+++ b/sim/testsuite/Makefile.in
@@ -171,11 +171,11 @@ distclean maintainer-clean realclean: clean
 	    done ; \
 	else true; fi
 
-Makefile : Makefile.in config.status
-	$(SHELL) config.status
+Makefile : Makefile.in ../config.status
+	$(SHELL) ../config.status
 
-config.status: $(srcdir)/configure
-	$(SHELL) ./config.status --recheck
+config.status: $(srcdir)/../configure
+	$(SHELL) ../config.status --recheck
 # FIXME: Requires --enable-maintainer-mode, which one could add, but
 # it's provided by automake.  Maybe switch to automake someday.
 #$(srcdir)/configure: @MAINT@ $(srcdir)/configure.in
diff --git a/sim/testsuite/configure b/sim/testsuite/configure
deleted file mode 100755
index c90da3e6fff4..000000000000
--- a/sim/testsuite/configure
+++ /dev/null
diff --git a/sim/testsuite/configure.ac b/sim/testsuite/configure.ac
deleted file mode 100644
index 140eb7d5a762..000000000000
--- a/sim/testsuite/configure.ac
+++ /dev/null
@@ -1,16 +0,0 @@
-dnl Process this file file with autoconf to produce a configure script.
-dnl This file is a shell script fragment that supplies the information
-dnl necessary to tailor a template configure script into the configure
-dnl script appropriate for this directory.  For more information, check
-dnl any existing configure script.
-
-AC_INIT(common/bits-tst.c)
-
-CC=${CC-cc}
-AC_SUBST(CC)
-AC_CONFIG_AUX_DIR(../..)
-AC_CANONICAL_SYSTEM
-
-sinclude(../configure.tgt)
-
-AC_OUTPUT(Makefile)
-- 
2.28.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] sim: testsuite: allow tests to declare expected exit status
  2021-01-05  6:55 [PATCH 1/2] sim: testsuite: allow tests to declare expected exit status Mike Frysinger
                   ` (4 preceding siblings ...)
  2021-01-06  0:31 ` [PATCH] sim: testsuite: delete configure script Mike Frysinger
@ 2021-01-11 23:34 ` Mike Frysinger
  5 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2021-01-11 23:34 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 67 bytes --]

i'll push this series this week if there's no feedback on it
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-11 23:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-05  6:55 [PATCH 1/2] sim: testsuite: allow tests to declare expected exit status Mike Frysinger
2021-01-05  6:55 ` [PATCH 2/2] sim: m32r: clean up redundant test coverage Mike Frysinger
2021-01-05  7:30 ` [PATCH] sim: frv: " Mike Frysinger
2021-01-05  7:34 ` [PATCH] sim: mips: delete empty stub test dir Mike Frysinger
2021-01-05  8:17 ` [PATCH] sim: d10v: relocate tests & clean up test harness Mike Frysinger
2021-01-06  0:31 ` [PATCH] sim: testsuite: delete configure script Mike Frysinger
2021-01-11 23:34 ` [PATCH 1/2] sim: testsuite: allow tests to declare expected exit status 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).