aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-01-27 12:47:22 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-01-27 12:47:22 -0500
commit86cec7aa680700afacb202f72e6262eca73a4ec1 (patch)
tree1a47131cf0abc855e7cbe2b34f9c2927507fc523 /test
parentff028475a66c8d28c655d032e13388e6cbceffbc (diff)
Some initial runtime-less VM tests
Diffstat (limited to 'test')
-rw-r--r--test/cases/bytecode.bqn15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/cases/bytecode.bqn b/test/cases/bytecode.bqn
new file mode 100644
index 00000000..beb42694
--- /dev/null
+++ b/test/cases/bytecode.bqn
@@ -0,0 +1,15 @@
+# Tests of bytecode operations. Compile with cjs.bqn.
+
+# Tests are meant to be run in order; comments indicate new instructions
+# introduced by each.
+
+5 % 5 # 0 PUSH, 25 RETN
+3 % 4⋄3 # 14 POPS
+5 % a←5 # 22 LOCM, 11 SETN
+2 % a←2⋄b←3⋄a # 21 LOCO
+1 % a←1⋄A 4 # 16 FN1O
+2 % a←2⋄3 A 4 # 17 FN2O
+6 % {𝕩}6 # 15 DFND
+3 % A←{𝕨}⋄3 A 4
+7 % a‿b←7‿2⋄a # 3 ARRO, 4 ARRM
+4 % 4{𝔽}6 # 7 OP1D