aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/lm32/testutils.inc
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-01-05 22:09:57 -0500
committerMike Frysinger <vapier@gentoo.org>2021-01-15 19:18:34 -0500
commit1368b914e93a3af332f787d3d41c106d11bb90da (patch)
tree9893ccae5d2d8cbf2ce855e09d6b8f30b56a21bc /sim/testsuite/lm32/testutils.inc
parente403a898b5893337baea73bcb001ece74042f351 (diff)
downloadgdb-1368b914e93a3af332f787d3d41c106d11bb90da.zip
gdb-1368b914e93a3af332f787d3d41c106d11bb90da.tar.gz
gdb-1368b914e93a3af332f787d3d41c106d11bb90da.tar.bz2
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.
Diffstat (limited to 'sim/testsuite/lm32/testutils.inc')
-rw-r--r--sim/testsuite/lm32/testutils.inc59
1 files changed, 59 insertions, 0 deletions
diff --git a/sim/testsuite/lm32/testutils.inc b/sim/testsuite/lm32/testutils.inc
new file mode 100644
index 0000000..0f62e3a
--- /dev/null
+++ b/sim/testsuite/lm32/testutils.inc
@@ -0,0 +1,59 @@
+# MACRO: exit
+ .macro exit nr
+ mvi r1, \nr;
+ # Trap function 1: exit().
+ mvi r8, 1;
+ scall;
+ .endm
+
+# MACRO: pass
+# Write 'pass' to stdout and quit
+ .macro pass
+ # Trap function 5: write().
+ mvi r8, 5;
+ # Use stdout.
+ mvi r1, 1;
+ # Point to the string.
+ mvhi r2, hi(1f)
+ ori r2, r2, lo(1f)
+ # Number of bytes to write.
+ mvi r3, 5;
+ # Trigger OS trap.
+ scall;
+ exit 0
+ .data
+ 1: .asciz "pass\n"
+ .endm
+
+# MACRO: fail
+# Write 'fail' to stdout and quit
+ .macro fail
+ # Trap function 5: write().
+ mvi r8, 5;
+ # Use stdout.
+ mvi r1, 1;
+ # Point to the string.
+ mvhi r2, hi(1f)
+ ori r2, r2, lo(1f)
+ # Number of bytes to write.
+ mvi r3, 5;
+ # Trigger OS trap.
+ scall;
+ exit 0
+ .data
+ 1: .asciz "fail\n"
+ .endm
+
+# MACRO: start
+# All assembler tests should start with a call to "start"
+ .macro start
+ .data
+.global _fstack
+_fstack:
+ .rept 0x1024
+ .byte 00
+ .endr
+ .text
+.global _start
+_start:
+ .endm