aboutsummaryrefslogtreecommitdiff
path: root/debug/programs
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2017-06-20 15:02:28 -0700
committerTim Newsome <tim@sifive.com>2017-06-20 15:02:28 -0700
commit9ff4594d26f485495f47d4473905af9c4f10caa8 (patch)
tree822f1c2355640dddb31d92e4e748008583ee12d1 /debug/programs
parent9e313f30205b8172290831c3af18b0779e9b15f2 (diff)
downloadriscv-tests-9ff4594d26f485495f47d4473905af9c4f10caa8.zip
riscv-tests-9ff4594d26f485495f47d4473905af9c4f10caa8.tar.gz
riscv-tests-9ff4594d26f485495f47d4473905af9c4f10caa8.tar.bz2
Smoketest multicore.
When connecting to gdb, select a random thread and use that for the current test. Also replace infinite_loop with something that will later allow smoketesting of more than one thread.
Diffstat (limited to 'debug/programs')
-rw-r--r--debug/programs/infinite_loop.S40
-rw-r--r--debug/programs/infinite_loop.c9
2 files changed, 40 insertions, 9 deletions
diff --git a/debug/programs/infinite_loop.S b/debug/programs/infinite_loop.S
new file mode 100644
index 0000000..4b83143
--- /dev/null
+++ b/debug/programs/infinite_loop.S
@@ -0,0 +1,40 @@
+#include "encoding.h"
+
+ .global main
+
+ // Load constants into all registers so we can test no register are
+ // clobbered after attaching.
+main:
+ csrr x1, CSR_MISA
+ slli x2, x1, 1
+ slli x3, x2, 1
+ slli x4, x3, 1
+ slli x5, x4, 1
+ slli x6, x5, 1
+ slli x7, x6, 1
+ slli x8, x7, 1
+ slli x9, x8, 1
+ slli x10, x9, 1
+ slli x11, x10, 1
+ slli x12, x11, 1
+ slli x13, x12, 1
+ slli x14, x13, 1
+ slli x15, x14, 1
+ slli x16, x15, 1
+ slli x17, x16, 1
+ slli x18, x17, 1
+ slli x19, x18, 1
+ slli x20, x19, 1
+ slli x21, x20, 1
+ slli x22, x21, 1
+ slli x23, x22, 1
+ slli x24, x23, 1
+ slli x25, x24, 1
+ slli x26, x25, 1
+ slli x27, x26, 1
+ slli x28, x27, 1
+ slli x29, x28, 1
+ slli x30, x29, 1
+ slli x31, x30, 1
+1:
+ j 1b
diff --git a/debug/programs/infinite_loop.c b/debug/programs/infinite_loop.c
deleted file mode 100644
index 350d1de..0000000
--- a/debug/programs/infinite_loop.c
+++ /dev/null
@@ -1,9 +0,0 @@
-volatile int forever = 1;
-
-int main()
-{
- while (forever)
- ;
-
- return 1;
-}