aboutsummaryrefslogtreecommitdiff
path: root/isa/rv32ui/j.S
diff options
context:
space:
mode:
Diffstat (limited to 'isa/rv32ui/j.S')
-rw-r--r--isa/rv32ui/j.S47
1 files changed, 47 insertions, 0 deletions
diff --git a/isa/rv32ui/j.S b/isa/rv32ui/j.S
new file mode 100644
index 0000000..0a4ca32
--- /dev/null
+++ b/isa/rv32ui/j.S
@@ -0,0 +1,47 @@
+#*****************************************************************************
+# j.S
+#-----------------------------------------------------------------------------
+#
+# Test j instruction.
+#
+
+#include "riscv_test.h"
+#include "test_macros.h"
+
+RVTEST_RV32U
+RVTEST_CODE_BEGIN
+
+ #-------------------------------------------------------------
+ # Test basic
+ #-------------------------------------------------------------
+
+ li x28, 2;
+ j test_2;
+ j fail;
+test_2:
+
+ #-------------------------------------------------------------
+ # Test delay slot instructions not executed nor bypassed
+ #-------------------------------------------------------------
+
+ TEST_CASE( 3, x1, 3, \
+ li x1, 1; \
+ j 1f; \
+ addi x1, x1, 1; \
+ addi x1, x1, 1; \
+ addi x1, x1, 1; \
+ addi x1, x1, 1; \
+1: addi x1, x1, 1; \
+ addi x1, x1, 1; \
+ )
+
+ TEST_PASSFAIL
+
+RVTEST_CODE_END
+
+ .data
+RVTEST_DATA_BEGIN
+
+ TEST_DATA
+
+RVTEST_DATA_END