sim: testsuite: flatten tree
Now that all port tests live under testsuite/sim/*/, and none live in testsuite/ directly, flatten the structure by moving all of the dirs under testsuite/sim/ to testsuite/ directly. We need to stop passing --tool to dejagnu so that it searches all dirs and not just ones that start with "sim". Since we have no other dirs in this tree, and no plans to add any, should be fine.
This commit is contained in:
parent
e403a898b5
commit
1368b914e9
2860 changed files with 5 additions and 1 deletions
10
sim/testsuite/m32c/ChangeLog
Normal file
10
sim/testsuite/m32c/ChangeLog
Normal file
|
@ -0,0 +1,10 @@
|
|||
2015-11-14 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* allinsn.exp: New file.
|
||||
* fail.s, pass.s: New tests.
|
||||
* testutils.inc: New test helper logic.
|
||||
|
||||
2015-11-09 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* blinky.s: Moved from ../../../m32c/.
|
||||
* gloss.s, sample.ld, sample.s, sample2.c: Likewise.
|
16
sim/testsuite/m32c/allinsn.exp
Normal file
16
sim/testsuite/m32c/allinsn.exp
Normal file
|
@ -0,0 +1,16 @@
|
|||
# M32C simulator testsuite.
|
||||
# TODO: Add support for .c tests.
|
||||
|
||||
if [istarget m32c*-*-*] {
|
||||
# all machines
|
||||
set all_machs "m32c"
|
||||
|
||||
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
|
||||
}
|
||||
}
|
34
sim/testsuite/m32c/blinky.s
Normal file
34
sim/testsuite/m32c/blinky.s
Normal file
|
@ -0,0 +1,34 @@
|
|||
;;; blinky.s --- sample program to blink LED's on M32C simulator
|
||||
;;;
|
||||
;;; Copyright (C) 2005-2021 Free Software Foundation, Inc.
|
||||
;;; Contributed by Red Hat, Inc.
|
||||
;;;
|
||||
;;; This file is part of the GNU simulators.
|
||||
;;;
|
||||
;;; 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/>.
|
||||
|
||||
.text
|
||||
|
||||
.global _start
|
||||
_start:
|
||||
mov.w #0xe1,a0
|
||||
top:
|
||||
sub.w #1,r0
|
||||
mov.b r0h,[a0]
|
||||
|
||||
mov.w #1000,r1
|
||||
loop:
|
||||
adjnz.w #-1,r1,loop
|
||||
|
||||
jmp.w top
|
9
sim/testsuite/m32c/fail.s
Normal file
9
sim/testsuite/m32c/fail.s
Normal file
|
@ -0,0 +1,9 @@
|
|||
# check that the sim doesn't die immediately.
|
||||
# mach: m32c
|
||||
# ld: -T$srcdir/$subdir/sample.ld
|
||||
# xerror:
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
start
|
||||
fail
|
32
sim/testsuite/m32c/gloss.s
Normal file
32
sim/testsuite/m32c/gloss.s
Normal file
|
@ -0,0 +1,32 @@
|
|||
;;; gloss.s --- system calls for sample2.x
|
||||
;;;
|
||||
;;; Copyright (C) 2005-2021 Free Software Foundation, Inc.
|
||||
;;; Contributed by Red Hat, Inc.
|
||||
;;;
|
||||
;;; This file is part of the GNU simulators.
|
||||
;;;
|
||||
;;; 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/>.
|
||||
|
||||
;;; See the 'sample2.x' target in Makefile.in.
|
||||
.global _exit
|
||||
_exit:
|
||||
mov.b #1,r0l
|
||||
ste.b r0l,0xe0000
|
||||
rts
|
||||
|
||||
.global _foo
|
||||
_foo:
|
||||
mov.b #2,r0l
|
||||
ste.b r0l,0xe0000
|
||||
rts
|
8
sim/testsuite/m32c/pass.s
Normal file
8
sim/testsuite/m32c/pass.s
Normal file
|
@ -0,0 +1,8 @@
|
|||
# check that the sim doesn't die immediately.
|
||||
# mach: m32c
|
||||
# ld: -T$srcdir/$subdir/sample.ld
|
||||
|
||||
.include "testutils.inc"
|
||||
|
||||
start
|
||||
pass
|
41
sim/testsuite/m32c/sample.ld
Normal file
41
sim/testsuite/m32c/sample.ld
Normal file
|
@ -0,0 +1,41 @@
|
|||
/* sample2.ld --- linker script for sample2.x
|
||||
|
||||
Copyright (C) 2005-2021 Free Software Foundation, Inc.
|
||||
Contributed by Red Hat, Inc.
|
||||
|
||||
This file is part of the GNU simulators.
|
||||
|
||||
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/>. */
|
||||
|
||||
/* See the 'sample2.x' target in Makefile.in. */
|
||||
|
||||
ENTRY(_start)
|
||||
|
||||
MEMORY {
|
||||
RAM1 (w) : ORIGIN = 0xc800, LENGTH = 0x0200
|
||||
RAM2 (w) : ORIGIN = 0xca56, LENGTH = 0x1000
|
||||
ROM (w) : ORIGIN = 0x30000, LENGTH = 0x1000
|
||||
}
|
||||
|
||||
SECTIONS {
|
||||
.data : {
|
||||
*(.data*)
|
||||
} > RAM1
|
||||
.text : {
|
||||
*(.text*)
|
||||
} > RAM2
|
||||
.fardata : {
|
||||
*(.fardata*)
|
||||
} > ROM
|
||||
}
|
27
sim/testsuite/m32c/sample.s
Normal file
27
sim/testsuite/m32c/sample.s
Normal file
|
@ -0,0 +1,27 @@
|
|||
;;; sample.s --- simple test program for M32C simulator
|
||||
;;;
|
||||
;;; Copyright (C) 2005-2021 Free Software Foundation, Inc.
|
||||
;;; Contributed by Red Hat, Inc.
|
||||
;;;
|
||||
;;; This file is part of the GNU simulators.
|
||||
;;;
|
||||
;;; 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/>.
|
||||
|
||||
.text
|
||||
|
||||
.global _start
|
||||
_start:
|
||||
mov.w #0x1234,r1
|
||||
mov.w r1,r3 | sha.w #-8,r3 | sha.w #-7,r3
|
||||
brk
|
29
sim/testsuite/m32c/sample2.c
Normal file
29
sim/testsuite/m32c/sample2.c
Normal file
|
@ -0,0 +1,29 @@
|
|||
/* sample2.c --- main source for sample2.x test program for M32C simulator
|
||||
|
||||
Copyright (C) 2005-2021 Free Software Foundation, Inc.
|
||||
Contributed by Red Hat, Inc.
|
||||
|
||||
This file is part of the GNU simulators.
|
||||
|
||||
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/>. */
|
||||
|
||||
/* See the 'sample2.x' target in Makefile.in. */
|
||||
void exit (int);
|
||||
|
||||
void
|
||||
start (void)
|
||||
{
|
||||
foo (1, 2, 3, 4);
|
||||
exit (5);
|
||||
}
|
53
sim/testsuite/m32c/testutils.inc
Normal file
53
sim/testsuite/m32c/testutils.inc
Normal file
|
@ -0,0 +1,53 @@
|
|||
# MACRO: exit
|
||||
.macro exit nr
|
||||
mov.w \nr, r1;
|
||||
# Trap function 1: exit().
|
||||
mov.b #1, r0l;
|
||||
ste.b r0l, 0x400;
|
||||
.endm
|
||||
|
||||
# MACRO: pass
|
||||
# Write 'pass' to stdout and quit
|
||||
.macro pass
|
||||
# Use stdout.
|
||||
mov.w #1, r1;
|
||||
# Point to the string.
|
||||
mov.w #1f, r2;
|
||||
# Number of bytes to write; push onto stack.
|
||||
push.w #5;
|
||||
# Adjust as the sim expects 3 byte offset. (!?)
|
||||
add.w #-3, sp;
|
||||
# Trap function 5: write().
|
||||
mov.b #5, r0l;
|
||||
ste.b r0l, 0x400;
|
||||
exit #0
|
||||
.data
|
||||
1: .asciz "pass\n"
|
||||
.endm
|
||||
|
||||
# MACRO: fail
|
||||
# Write 'fail' to stdout and quit
|
||||
.macro fail
|
||||
# Use stdout.
|
||||
mov.w #1, r1;
|
||||
# Point to the string.
|
||||
mov.w #1f, r2;
|
||||
# Number of bytes to write; push onto stack.
|
||||
push.w #5;
|
||||
# Adjust as the sim expects 3 byte offset. (!?)
|
||||
add.w #-3, sp;
|
||||
# Trap function 5: write().
|
||||
mov.b #5, r0l;
|
||||
ste.b r0l, 0x400;
|
||||
exit #1
|
||||
.data
|
||||
1: .asciz "fail\n"
|
||||
.endm
|
||||
|
||||
# MACRO: start
|
||||
# All assembler tests should start with a call to "start"
|
||||
.macro start
|
||||
.text
|
||||
.global _start
|
||||
_start:
|
||||
.endm
|
Loading…
Add table
Add a link
Reference in a new issue