* [PATCH] sim: unify target->subdir handling for default tests
@ 2010-04-21 21:12 Mike Frysinger
2010-04-21 22:32 ` Doug Evans
2010-04-26 16:24 ` Mike Frysinger
0 siblings, 2 replies; 6+ messages in thread
From: Mike Frysinger @ 2010-04-21 21:12 UTC (permalink / raw)
To: gdb-patches
The testsuite subdir has a note about unifying the target->subdir logic,
so do just that. The end goal here is to have `make check` work out of
the box without having to delve into dejagnu internals.
The target-specific logic is split out of the top level configure.ac file
and into a dedicated configure.tgt similar to other subprojects (gdb and
ld and etc...) with the difference that this file has to be included at
the m4 level instead of the shell level. This is necessary only because
autoconf requires AC_CONFIG_SUBDIRS be given a string literal and not a
variable value.
Then the toplevel and the testsuite configure files pull this in, the sim
subdir gets expanded into testsuite/site.exp, and the default sim run code
uses this info to set the sim path to the local compiled run file if it
hasn't already been specified.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sim/:
2010-04-21 Mike Frysinger <vapier@gentoo.org>
* configure.ac: Target logic moved out to and included from ...
* configure.tgt: ... this new file.
* configure: Regenerated.
sim/testsuite/:
2010-04-21 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (arch): Set to @sim_arch@.
* configure.ac: Delete arch logic and include ../configure.tgt.
* configure: Regenerated.
* lib/sim-defs.exp (sim_run): Default sim to ../arch/run.
---
sim/configure.ac | 120 +++-------------------------------------
sim/configure.tgt | 114 ++++++++++++++++++++++++++++++++++++++
sim/testsuite/Makefile.in | 2 +-
sim/testsuite/configure.ac | 8 +--
sim/testsuite/lib/sim-defs.exp | 9 +++
5 files changed, 133 insertions(+), 120 deletions(-)
create mode 100644 sim/configure.tgt
diff --git a/sim/configure.ac b/sim/configure.ac
index 91109c5..3adb66e 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -36,123 +36,19 @@ yes | no) ;;
*) AC_MSG_ERROR(bad value ${enableval} given for --enable-sim option) ;;
esac])
-# WHEN ADDING ENTRIES TO THIS MATRIX:
-
-# Make sure that the left side always has two dashes. Otherwise you
-# can get spurious matches. Even for unambiguous cases, do this as a
-# convention, else the table becomes a real mess to understand and
-# maintain.
-
+AC_DEFUN([SIM_ARCH], [
+ sim_arch=$1
+ AC_CONFIG_SUBDIRS($1)
+])
if test "${enable_sim}" != no; then
- testsuite=no
- common=yes
- igen=no
- case "${target}" in
- arm*-*-* | thumb*-*-* | strongarm*-*-* | xscale-*-*)
- AC_CONFIG_SUBDIRS(arm)
- testsuite=yes
- ;;
- avr*-*-*)
- AC_CONFIG_SUBDIRS(avr)
- ;;
- cr16*-*-*)
- AC_CONFIG_SUBDIRS(cr16)
- testsuite=yes
- ;;
- bfin-*-*)
- AC_CONFIG_SUBDIRS(bfin)
- testsuite=yes
- ;;
- cris-*-* | crisv32-*-*)
- AC_CONFIG_SUBDIRS(cris)
- testsuite=yes
- ;;
- d10v-*-*)
- AC_CONFIG_SUBDIRS(d10v)
- ;;
- frv-*-*)
- AC_CONFIG_SUBDIRS(frv)
- testsuite=yes
- ;;
- h8300*-*-*)
- AC_CONFIG_SUBDIRS(h8300)
- testsuite=yes
- ;;
- iq2000-*-*)
- AC_CONFIG_SUBDIRS(iq2000)
- testsuite=yes
- ;;
- lm32-*-*)
- AC_CONFIG_SUBDIRS(lm32)
- testsuite=yes
- ;;
- m32c-*-*)
- AC_CONFIG_SUBDIRS(m32c)
- ;;
- m32r-*-*)
- AC_CONFIG_SUBDIRS(m32r)
- testsuite=yes
- ;;
- m68hc11-*-*|m6811-*-*)
- AC_CONFIG_SUBDIRS(m68hc11)
- testsuite=yes
- ;;
- mcore-*-*)
- AC_CONFIG_SUBDIRS(mcore)
- testsuite=yes
- ;;
- microblaze-*-*)
- AC_CONFIG_SUBDIRS(microblaze)
- testsuite=yes
- ;;
- mips*-*-*)
- AC_CONFIG_SUBDIRS(mips)
- testsuite=yes
- igen=yes
- ;;
- mn10300*-*-*)
- AC_CONFIG_SUBDIRS(mn10300)
- igen=yes
- ;;
- moxie-*-*)
- AC_CONFIG_SUBDIRS(moxie)
- testsuite=yes
- ;;
- rx-*-*)
- AC_CONFIG_SUBDIRS(rx)
- ;;
- sh64*-*-*)
- AC_CONFIG_SUBDIRS(sh64)
- testsuite=yes
- ;;
- sh*-*-*)
- AC_CONFIG_SUBDIRS(sh)
- testsuite=yes
- ;;
- sparc-*-rtems*|sparc-*-elf*)
- AC_CONFIG_SUBDIRS(erc32)
- testsuite=yes
- ;;
- powerpc*-*-* )
- AC_CONFIG_SUBDIRS(ppc)
- ;;
- v850*-*-* )
- AC_CONFIG_SUBDIRS(v850)
- igen=yes
- testsuite=yes
- ;;
- *)
- # No simulator subdir, so the subdir "common" isn't needed.
- common=no
- ;;
- esac
- if test "$testsuite" = yes; then
+ sinclude(configure.tgt)
+ if test "$sim_testsuite" = yes; then
AC_CONFIG_SUBDIRS(testsuite)
fi
- if test "$common" = yes; then
+ if test "$sim_common" = yes; then
AC_CONFIG_SUBDIRS(common)
fi
- if test "$igen" = yes; then
+ if test "$sim_igen" = yes; then
AC_CONFIG_SUBDIRS(igen)
fi
fi
diff --git a/sim/configure.tgt b/sim/configure.tgt
new file mode 100644
index 0000000..5eaaa49
--- /dev/null
+++ b/sim/configure.tgt
@@ -0,0 +1,114 @@
+# WHEN ADDING ENTRIES TO THIS MATRIX:
+
+# Make sure that the left side always has two dashes. Otherwise you
+# can get spurious matches. Even for unambiguous cases, do this as a
+# convention, else the table becomes a real mess to understand and
+# maintain.
+
+dnl glue to avoid code duplication at top level
+m4_ifndef([SIM_ARCH], AC_DEFUN([SIM_ARCH],[sim_arch=$1]))
+
+sim_testsuite=no
+sim_common=yes
+sim_igen=no
+sim_arch=
+case "${target}" in
+ arm*-*-* | thumb*-*-* | strongarm*-*-* | xscale-*-*)
+ SIM_ARCH(arm)
+ sim_testsuite=yes
+ ;;
+ avr*-*-*)
+ SIM_ARCH(avr)
+ ;;
+ cr16*-*-*)
+ SIM_ARCH(cr16)
+ sim_testsuite=yes
+ ;;
+ bfin-*-*)
+ SIM_ARCH(bfin)
+ sim_testsuite=yes
+ ;;
+ cris-*-* | crisv32-*-*)
+ SIM_ARCH(cris)
+ sim_testsuite=yes
+ ;;
+ d10v-*-*)
+ SIM_ARCH(d10v)
+ ;;
+ frv-*-*)
+ SIM_ARCH(frv)
+ sim_testsuite=yes
+ ;;
+ h8300*-*-*)
+ SIM_ARCH(h8300)
+ sim_testsuite=yes
+ ;;
+ iq2000-*-*)
+ SIM_ARCH(iq2000)
+ sim_testsuite=yes
+ ;;
+ lm32-*-*)
+ SIM_ARCH(lm32)
+ sim_testsuite=yes
+ ;;
+ m32c-*-*)
+ SIM_ARCH(m32c)
+ ;;
+ m32r-*-*)
+ SIM_ARCH(m32r)
+ sim_testsuite=yes
+ ;;
+ m68hc11-*-*|m6811-*-*)
+ SIM_ARCH(m68hc11)
+ sim_testsuite=yes
+ ;;
+ mcore-*-*)
+ SIM_ARCH(mcore)
+ sim_testsuite=yes
+ ;;
+ microblaze-*-*)
+ SIM_ARCH(microblaze)
+ sim_testsuite=yes
+ ;;
+ mips*-*-*)
+ SIM_ARCH(mips)
+ sim_testsuite=yes
+ sim_igen=yes
+ ;;
+ mn10300*-*-*)
+ SIM_ARCH(mn10300)
+ sim_igen=yes
+ ;;
+ moxie-*-*)
+ SIM_ARCH(moxie)
+ sim_testsuite=yes
+ ;;
+ rx-*-*)
+ SIM_ARCH(rx)
+ ;;
+ sh64*-*-*)
+ SIM_ARCH(sh64)
+ sim_testsuite=yes
+ ;;
+ sh*-*-*)
+ SIM_ARCH(sh)
+ sim_testsuite=yes
+ ;;
+ sparc-*-rtems*|sparc-*-elf*)
+ SIM_ARCH(erc32)
+ sim_testsuite=yes
+ ;;
+ powerpc*-*-*)
+ SIM_ARCH(ppc)
+ ;;
+ v850*-*-*)
+ SIM_ARCH(v850)
+ sim_igen=yes
+ sim_testsuite=yes
+ ;;
+ *)
+ # No simulator subdir, so the subdir "common" isn't needed.
+ sim_common=no
+ ;;
+esac
+AC_SUBST(sim_arch)
diff --git a/sim/testsuite/Makefile.in b/sim/testsuite/Makefile.in
index 6a60f95..bfb721d 100644
--- a/sim/testsuite/Makefile.in
+++ b/sim/testsuite/Makefile.in
@@ -30,7 +30,7 @@ target_canonical = @target@
target_alias = @target_alias@
program_transform_name = @program_transform_name@
-arch = @arch@
+arch = @sim_arch@
SHELL = /bin/sh
SUBDIRS = @subdirs@
diff --git a/sim/testsuite/configure.ac b/sim/testsuite/configure.ac
index ceaf4ff..ba17a33 100644
--- a/sim/testsuite/configure.ac
+++ b/sim/testsuite/configure.ac
@@ -25,12 +25,6 @@ case ${target} in
;;
esac
-# Compute the target architecture.
-# FIXME: Will need to canonicalize some values.
-# FIXME: Should be in generally accessable place.
-case $target in
- *) arch=${target_cpu} ;;
-esac
-AC_SUBST(arch)
+sinclude(../configure.tgt)
AC_OUTPUT(Makefile)
diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp
index 9314f2f..eacdf76 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -88,6 +88,15 @@ proc sim_run { prog sim_opts prog_opts redir options } {
verbose "testcase timeout is set to $testcase_timeout" 1
set sim [board_info target sim]
+ if [string equal "" $sim] {
+ # Special case the simulator. These tests are designed to
+ # be run inside of the simulator, not on the native host.
+ # So if the sim target isn't set, default to the target run.
+ # These global variables come from generated site.exp.
+ global objdir
+ global arch
+ set sim "$objdir/../$arch/run"
+ }
if [is_remote host] {
set prog [remote_download host $prog]
--
1.7.0.2
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] sim: unify target->subdir handling for default tests
2010-04-21 21:12 [PATCH] sim: unify target->subdir handling for default tests Mike Frysinger
@ 2010-04-21 22:32 ` Doug Evans
2010-04-22 2:03 ` Mike Frysinger
2010-04-22 2:06 ` Mike Frysinger
2010-04-26 16:24 ` Mike Frysinger
1 sibling, 2 replies; 6+ messages in thread
From: Doug Evans @ 2010-04-21 22:32 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb-patches
On Wed, Apr 21, 2010 at 2:12 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> The testsuite subdir has a note about unifying the target->subdir logic,
> so do just that. The end goal here is to have `make check` work out of
> the box without having to delve into dejagnu internals.
>
> The target-specific logic is split out of the top level configure.ac file
> and into a dedicated configure.tgt similar to other subprojects (gdb and
> ld and etc...) with the difference that this file has to be included at
> the m4 level instead of the shell level. This is necessary only because
> autoconf requires AC_CONFIG_SUBDIRS be given a string literal and not a
> variable value.
>
> Then the toplevel and the testsuite configure files pull this in, the sim
> subdir gets expanded into testsuite/site.exp, and the default sim run code
> uses this info to set the sim path to the local compiled run file if it
> hasn't already been specified.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
>
> sim/:
> 2010-04-21 Mike Frysinger <vapier@gentoo.org>
>
> * configure.ac: Target logic moved out to and included from ...
> * configure.tgt: ... this new file.
> * configure: Regenerated.
>
> sim/testsuite/:
> 2010-04-21 Mike Frysinger <vapier@gentoo.org>
>
> * Makefile.in (arch): Set to @sim_arch@.
> * configure.ac: Delete arch logic and include ../configure.tgt.
> * configure: Regenerated.
> * lib/sim-defs.exp (sim_run): Default sim to ../arch/run.
> ---
> sim/configure.ac | 120 +++-------------------------------------
> sim/configure.tgt | 114 ++++++++++++++++++++++++++++++++++++++
> sim/testsuite/Makefile.in | 2 +-
> sim/testsuite/configure.ac | 8 +--
> sim/testsuite/lib/sim-defs.exp | 9 +++
> 5 files changed, 133 insertions(+), 120 deletions(-)
> create mode 100644 sim/configure.tgt
>
This is ok with me with a few qualifications.
I'd leave it for a few days to see if anyone else wants to comment.
I'd add a comment to configure.tgt saying that it's intended to be m4-included.
[It's kinda clear since a few lines in there's an m4 command :-), but
an explicit comment would help, I think.]
How have you tested it?
[I'd test it on at least two targets, if not more.]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sim: unify target->subdir handling for default tests
2010-04-21 22:32 ` Doug Evans
@ 2010-04-22 2:03 ` Mike Frysinger
2010-04-22 2:26 ` Mike Frysinger
2010-04-22 2:06 ` Mike Frysinger
1 sibling, 1 reply; 6+ messages in thread
From: Mike Frysinger @ 2010-04-22 2:03 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb-patches
[-- Attachment #1: Type: Text/Plain, Size: 1836 bytes --]
On Wednesday 21 April 2010 18:32:22 Doug Evans wrote:
> How have you tested it?
> [I'd test it on at least two targets, if not more.]
i do most development against the Blackfin port, but i wrote a small script to
build/test all known working targets, and these all pass for me (which is to
say, there are actually tests that get compiled/run in their respective sim):
arm frv sh v850
emphasis is that i can now do `make check` for any target without having to
set up dejagnu in any way.
the attached patch removes the workaround in the mips testsuite so that it too
works out of the box.
these targets also pass, but they lack any sort of testsuite (who does that?),
so that isnt saying much:
avr m32c mn10300 moxie ppc rx
h8300 fails a few tests, but that appears to be a bug in its assembler while
running on 64bit hosts. the rest pass fine.
cr16 fails horribly, but it seems to be a bug in its own testsuite (every link
warns about missing entry point and the sim framework interprets that as a
failure).
as for the remaining targets, they dont even build for me for various reasons
for which i blame them ;).
-mike
RCS file: /cvs/src/src/sim/testsuite/sim/mips/basic.exp,v
retrieving revision 1.9
diff -u -p -r1.9 basic.exp
--- sim/testsuite/sim/mips/basic.exp 20 Feb 2007 13:28:55 -0000 1.9
+++ sim/testsuite/sim/mips/basic.exp 22 Apr 2010 02:01:32 -0000
@@ -32,9 +32,8 @@ proc run_hilo_test {testfile models nops
}
-# Only test mips*-*-elf (e.g., no mips*-*-linux), and only test if the target
-# board really is a simulator (sim tests don't work on real HW).
-if {[istarget mips*-*-elf] && [board_info target exists is_simulator]} {
+# Only test mips*-*-elf (e.g., no mips*-*-linux)
+if {[istarget mips*-*-elf]} {
set dspmodels ""
set mdmxmodels ""
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] sim: unify target->subdir handling for default tests
2010-04-21 22:32 ` Doug Evans
2010-04-22 2:03 ` Mike Frysinger
@ 2010-04-22 2:06 ` Mike Frysinger
1 sibling, 0 replies; 6+ messages in thread
From: Mike Frysinger @ 2010-04-22 2:06 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb-patches
[-- Attachment #1: Type: Text/Plain, Size: 8904 bytes --]
On Wednesday 21 April 2010 18:32:22 Doug Evans wrote:
> I'd add a comment to configure.tgt saying that it's intended to be
> m4-included. [It's kinda clear since a few lines in there's an m4 command
> :-), but an explicit comment would help, I think.]
here is the updated patch with your feedback. i also noticed that it had
Blackfin fragments that arent yet appropriate, so ive dropped those.
if no one complains, i'll prob commit this weekend.
-mike
sim/:
2010-04-21 Mike Frysinger <vapier@gentoo.org>
* configure.ac: Target logic moved out to and included from ...
* configure.tgt: ... this new file.
* configure: Regenerated.
sim/testsuite/:
2010-04-21 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (arch): Set to @sim_arch@.
* configure.ac: Delete arch logic and include ../configure.tgt.
* configure: Regenerated.
* lib/sim-defs.exp (sim_run): Default sim to ../arch/run.
---
sim/configure.ac | 116 +++-------------------------------------
sim/configure.tgt | 113 ++++++++++++++++++++++++++++++++++++++
sim/testsuite/Makefile.in | 2 +-
sim/testsuite/configure.ac | 8 +---
sim/testsuite/lib/sim-defs.exp | 9 +++
5 files changed, 132 insertions(+), 116 deletions(-)
create mode 100644 sim/configure.tgt
diff --git a/sim/configure.ac b/sim/configure.ac
index dad245e..8c1d914 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -36,119 +36,19 @@ yes | no) ;;
*) AC_MSG_ERROR(bad value ${enableval} given for --enable-sim option) ;;
esac])
-# WHEN ADDING ENTRIES TO THIS MATRIX:
-
-# Make sure that the left side always has two dashes. Otherwise you
-# can get spurious matches. Even for unambiguous cases, do this as a
-# convention, else the table becomes a real mess to understand and
-# maintain.
-
+m4_define([SIM_ARCH], [
+ sim_arch=$1
+ AC_CONFIG_SUBDIRS($1)
+])
if test "${enable_sim}" != no; then
- testsuite=no
- common=yes
- igen=no
- case "${target}" in
- arm*-*-* | thumb*-*-* | strongarm*-*-* | xscale-*-*)
- AC_CONFIG_SUBDIRS(arm)
- testsuite=yes
- ;;
- avr*-*-*)
- AC_CONFIG_SUBDIRS(avr)
- ;;
- cr16*-*-*)
- AC_CONFIG_SUBDIRS(cr16)
- testsuite=yes
- ;;
- cris-*-* | crisv32-*-*)
- AC_CONFIG_SUBDIRS(cris)
- testsuite=yes
- ;;
- d10v-*-*)
- AC_CONFIG_SUBDIRS(d10v)
- ;;
- frv-*-*)
- AC_CONFIG_SUBDIRS(frv)
- testsuite=yes
- ;;
- h8300*-*-*)
- AC_CONFIG_SUBDIRS(h8300)
- testsuite=yes
- ;;
- iq2000-*-*)
- AC_CONFIG_SUBDIRS(iq2000)
- testsuite=yes
- ;;
- lm32-*-*)
- AC_CONFIG_SUBDIRS(lm32)
- testsuite=yes
- ;;
- m32c-*-*)
- AC_CONFIG_SUBDIRS(m32c)
- ;;
- m32r-*-*)
- AC_CONFIG_SUBDIRS(m32r)
- testsuite=yes
- ;;
- m68hc11-*-*|m6811-*-*)
- AC_CONFIG_SUBDIRS(m68hc11)
- testsuite=yes
- ;;
- mcore-*-*)
- AC_CONFIG_SUBDIRS(mcore)
- testsuite=yes
- ;;
- microblaze-*-*)
- AC_CONFIG_SUBDIRS(microblaze)
- testsuite=yes
- ;;
- mips*-*-*)
- AC_CONFIG_SUBDIRS(mips)
- testsuite=yes
- igen=yes
- ;;
- mn10300*-*-*)
- AC_CONFIG_SUBDIRS(mn10300)
- igen=yes
- ;;
- moxie-*-*)
- AC_CONFIG_SUBDIRS(moxie)
- testsuite=yes
- ;;
- rx-*-*)
- AC_CONFIG_SUBDIRS(rx)
- ;;
- sh64*-*-*)
- AC_CONFIG_SUBDIRS(sh64)
- testsuite=yes
- ;;
- sh*-*-*)
- AC_CONFIG_SUBDIRS(sh)
- testsuite=yes
- ;;
- sparc-*-rtems*|sparc-*-elf*)
- AC_CONFIG_SUBDIRS(erc32)
- testsuite=yes
- ;;
- powerpc*-*-* )
- AC_CONFIG_SUBDIRS(ppc)
- ;;
- v850*-*-* )
- AC_CONFIG_SUBDIRS(v850)
- igen=yes
- testsuite=yes
- ;;
- *)
- # No simulator subdir, so the subdir "common" isn't needed.
- common=no
- ;;
- esac
- if test "$testsuite" = yes; then
+ sinclude(configure.tgt)
+ if test "$sim_testsuite" = yes; then
AC_CONFIG_SUBDIRS(testsuite)
fi
- if test "$common" = yes; then
+ if test "$sim_common" = yes; then
AC_CONFIG_SUBDIRS(common)
fi
- if test "$igen" = yes; then
+ if test "$sim_igen" = yes; then
AC_CONFIG_SUBDIRS(igen)
fi
fi
diff --git a/sim/configure.tgt b/sim/configure.tgt
new file mode 100644
index 0000000..592bc3c
--- /dev/null
+++ b/sim/configure.tgt
@@ -0,0 +1,113 @@
+dnl Note that this file is intended to be included at the m4 level and not
+dnl the shell level, so use sinclude(...) to pull it in.
+
+# WHEN ADDING ENTRIES TO THIS MATRIX:
+
+# Make sure that the left side always has two dashes. Otherwise you
+# can get spurious matches. Even for unambiguous cases, do this as a
+# convention, else the table becomes a real mess to understand and
+# maintain.
+
+dnl glue to avoid code duplication at top level
+m4_ifndef([SIM_ARCH], [AC_DEFUN([SIM_ARCH],[sim_arch=$1])])
+
+sim_testsuite=no
+sim_common=yes
+sim_igen=no
+sim_arch=
+case "${target}" in
+ arm*-*-* | thumb*-*-* | strongarm*-*-* | xscale-*-*)
+ SIM_ARCH(arm)
+ sim_testsuite=yes
+ ;;
+ avr*-*-*)
+ SIM_ARCH(avr)
+ ;;
+ cr16*-*-*)
+ SIM_ARCH(cr16)
+ sim_testsuite=yes
+ ;;
+ cris-*-* | crisv32-*-*)
+ SIM_ARCH(cris)
+ sim_testsuite=yes
+ ;;
+ d10v-*-*)
+ SIM_ARCH(d10v)
+ ;;
+ frv-*-*)
+ SIM_ARCH(frv)
+ sim_testsuite=yes
+ ;;
+ h8300*-*-*)
+ SIM_ARCH(h8300)
+ sim_testsuite=yes
+ ;;
+ iq2000-*-*)
+ SIM_ARCH(iq2000)
+ sim_testsuite=yes
+ ;;
+ lm32-*-*)
+ SIM_ARCH(lm32)
+ sim_testsuite=yes
+ ;;
+ m32c-*-*)
+ SIM_ARCH(m32c)
+ ;;
+ m32r-*-*)
+ SIM_ARCH(m32r)
+ sim_testsuite=yes
+ ;;
+ m68hc11-*-*|m6811-*-*)
+ SIM_ARCH(m68hc11)
+ sim_testsuite=yes
+ ;;
+ mcore-*-*)
+ SIM_ARCH(mcore)
+ sim_testsuite=yes
+ ;;
+ microblaze-*-*)
+ SIM_ARCH(microblaze)
+ sim_testsuite=yes
+ ;;
+ mips*-*-*)
+ SIM_ARCH(mips)
+ sim_testsuite=yes
+ sim_igen=yes
+ ;;
+ mn10300*-*-*)
+ SIM_ARCH(mn10300)
+ sim_igen=yes
+ ;;
+ moxie-*-*)
+ SIM_ARCH(moxie)
+ sim_testsuite=yes
+ ;;
+ rx-*-*)
+ SIM_ARCH(rx)
+ ;;
+ sh64*-*-*)
+ SIM_ARCH(sh64)
+ sim_testsuite=yes
+ ;;
+ sh*-*-*)
+ SIM_ARCH(sh)
+ sim_testsuite=yes
+ ;;
+ sparc-*-rtems*|sparc-*-elf*)
+ SIM_ARCH(erc32)
+ sim_testsuite=yes
+ ;;
+ powerpc*-*-*)
+ SIM_ARCH(ppc)
+ ;;
+ v850*-*-*)
+ SIM_ARCH(v850)
+ sim_igen=yes
+ sim_testsuite=yes
+ ;;
+ *)
+ # No simulator subdir, so the subdir "common" isn't needed.
+ sim_common=no
+ ;;
+esac
+AC_SUBST(sim_arch)
diff --git a/sim/testsuite/Makefile.in b/sim/testsuite/Makefile.in
index 6a60f95..bfb721d 100644
--- a/sim/testsuite/Makefile.in
+++ b/sim/testsuite/Makefile.in
@@ -30,7 +30,7 @@ target_canonical = @target@
target_alias = @target_alias@
program_transform_name = @program_transform_name@
-arch = @arch@
+arch = @sim_arch@
SHELL = /bin/sh
SUBDIRS = @subdirs@
diff --git a/sim/testsuite/configure.ac b/sim/testsuite/configure.ac
index ceaf4ff..ba17a33 100644
--- a/sim/testsuite/configure.ac
+++ b/sim/testsuite/configure.ac
@@ -25,12 +25,6 @@ case ${target} in
;;
esac
-# Compute the target architecture.
-# FIXME: Will need to canonicalize some values.
-# FIXME: Should be in generally accessable place.
-case $target in
- *) arch=${target_cpu} ;;
-esac
-AC_SUBST(arch)
+sinclude(../configure.tgt)
AC_OUTPUT(Makefile)
diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp
index 3cef394..1e65817 100644
--- a/sim/testsuite/lib/sim-defs.exp
+++ b/sim/testsuite/lib/sim-defs.exp
@@ -88,6 +88,15 @@ proc sim_run { prog sim_opts prog_opts redir options } {
verbose "testcase timeout is set to $testcase_timeout" 1
set sim [board_info target sim]
+ if [string equal "" $sim] {
+ # Special case the simulator. These tests are designed to
+ # be run inside of the simulator, not on the native host.
+ # So if the sim target isn't set, default to the target run.
+ # These global variables come from generated site.exp.
+ global objdir
+ global arch
+ set sim "$objdir/../$arch/run"
+ }
if [is_remote host] {
set prog [remote_download host $prog]
--
1.7.0.2
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sim: unify target->subdir handling for default tests
2010-04-21 21:12 [PATCH] sim: unify target->subdir handling for default tests Mike Frysinger
2010-04-21 22:32 ` Doug Evans
@ 2010-04-26 16:24 ` Mike Frysinger
1 sibling, 0 replies; 6+ messages in thread
From: Mike Frysinger @ 2010-04-26 16:24 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: Text/Plain, Size: 26 bytes --]
ive pushed this now
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-04-26 16:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-21 21:12 [PATCH] sim: unify target->subdir handling for default tests Mike Frysinger
2010-04-21 22:32 ` Doug Evans
2010-04-22 2:03 ` Mike Frysinger
2010-04-22 2:26 ` Mike Frysinger
2010-04-22 2:06 ` Mike Frysinger
2010-04-26 16:24 ` Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox