summaryrefslogtreecommitdiff
path: root/projects/Stacker
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-11-23 18:12:22 +0000
committerChris Lattner <sabre@nondot.org>2003-11-23 18:12:22 +0000
commite44f1db6e69beb9ecb30dff75ca25c4963af7df0 (patch)
tree1794614e76a1267efc1c8f53ecdae63263522f39 /projects/Stacker
parent76100293464fff5af6efb52b4a09bd948810c68c (diff)
downloadllvm-e44f1db6e69beb9ecb30dff75ca25c4963af7df0.tar.gz
llvm-e44f1db6e69beb9ecb30dff75ca25c4963af7df0.tar.bz2
llvm-e44f1db6e69beb9ecb30dff75ca25c4963af7df0.tar.xz
Checkin tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10187 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'projects/Stacker')
-rw-r--r--projects/Stacker/test/Makefile61
-rw-r--r--projects/Stacker/test/abs.st6
-rw-r--r--projects/Stacker/test/add.st7
-rw-r--r--projects/Stacker/test/and.st7
-rw-r--r--projects/Stacker/test/decr.st6
-rw-r--r--projects/Stacker/test/div.st6
-rw-r--r--projects/Stacker/test/drop.st6
-rw-r--r--projects/Stacker/test/drop2.st7
-rw-r--r--projects/Stacker/test/dup.st8
-rw-r--r--projects/Stacker/test/dup2.st7
-rw-r--r--projects/Stacker/test/eq.st6
-rw-r--r--projects/Stacker/test/false.st6
-rw-r--r--projects/Stacker/test/ge.st7
-rw-r--r--projects/Stacker/test/gt.st6
-rw-r--r--projects/Stacker/test/incr.st6
-rw-r--r--projects/Stacker/test/le.st7
-rw-r--r--projects/Stacker/test/lt.st7
-rw-r--r--projects/Stacker/test/max.st7
-rw-r--r--projects/Stacker/test/memory.st10
-rw-r--r--projects/Stacker/test/min.st7
-rw-r--r--projects/Stacker/test/mod.st6
-rw-r--r--projects/Stacker/test/mul.st6
-rw-r--r--projects/Stacker/test/ne.st6
-rw-r--r--projects/Stacker/test/neg.st6
-rw-r--r--projects/Stacker/test/nip.st6
-rw-r--r--projects/Stacker/test/nip2.st9
-rw-r--r--projects/Stacker/test/or.st7
-rw-r--r--projects/Stacker/test/out_chr.st5
-rw-r--r--projects/Stacker/test/out_num.st5
-rw-r--r--projects/Stacker/test/out_str.st5
-rw-r--r--projects/Stacker/test/over.st9
-rw-r--r--projects/Stacker/test/over2.st14
-rw-r--r--projects/Stacker/test/pick.st9
-rw-r--r--projects/Stacker/test/recurse.st7
-rw-r--r--projects/Stacker/test/return.st8
-rw-r--r--projects/Stacker/test/roll.st5
-rw-r--r--projects/Stacker/test/rot.st9
-rw-r--r--projects/Stacker/test/rot2.st14
-rw-r--r--projects/Stacker/test/rrot.st12
-rw-r--r--projects/Stacker/test/rrot2.st14
-rw-r--r--projects/Stacker/test/select.st7
-rw-r--r--projects/Stacker/test/shl.st7
-rw-r--r--projects/Stacker/test/shr.st7
-rw-r--r--projects/Stacker/test/space.st5
-rw-r--r--projects/Stacker/test/star_slash.st6
-rw-r--r--projects/Stacker/test/sub.st6
-rw-r--r--projects/Stacker/test/swap.st9
-rw-r--r--projects/Stacker/test/swap2.st10
-rw-r--r--projects/Stacker/test/tab.st5
-rw-r--r--projects/Stacker/test/testing.st5
-rw-r--r--projects/Stacker/test/true.st6
-rw-r--r--projects/Stacker/test/tuck.st11
-rw-r--r--projects/Stacker/test/tuck2.st14
-rw-r--r--projects/Stacker/test/while.st8
-rw-r--r--projects/Stacker/test/xor.st6
55 files changed, 464 insertions, 0 deletions
diff --git a/projects/Stacker/test/Makefile b/projects/Stacker/test/Makefile
new file mode 100644
index 0000000000..c7680dcaf5
--- /dev/null
+++ b/projects/Stacker/test/Makefile
@@ -0,0 +1,61 @@
+##===- projects/sample/Makefile ----------------------------*- Makefile -*-===##
+#
+# This is a sample Makefile for a project that uses LLVM.
+#
+##===----------------------------------------------------------------------===##
+
+#
+# Indicates our relative path to the top of the project's root directory.
+#
+LEVEL = ../../..
+
+#
+# Directories that needs to be built.
+#
+DIRS =
+
+#
+# Include the Master Makefile that knows how to build all.
+#
+include $(LEVEL)/Makefile.common
+
+LOGIC_TESTS = eq ne le ge gt lt false true
+BITWISE_TESTS = shl shr xor or and
+ARITHMETIC_TESTS = abs neg add sub mul div mod star_slash incr decr min max
+STACK_TESTS = drop drop2 nip nip2 dup dup2 swap swap2 over over2 rot rot2 \
+ rrot rrot2 tuck tuck2 roll pick select
+MEMORY_TESTS = memory
+CONTROL_TESTS = while return
+IO_TESTS = space tab out_chr out_num out_str
+
+TESTS = $(LOGIC_TESTS) $(ARITHMETIC_TESTS) $(BITWISE_TESTS) $(STACK_TESTS) \
+ $(MEMORY_TESTS) $(CONTROL_TESTS) $(IO_TESTS)
+
+all :: test_each
+
+test_each: $(TESTS)
+ $(BUILD_SRC_DIR)/runtests $(BUILD_OBJ_DIR) $(TESTS)
+
+% : %.s testing.s
+ gcc -ggdb -L$(BUILD_OBJ_ROOT)/lib/Debug testing.s -lstkr_runtime -o $* $*.s
+
+%.s : %.bc
+ llc -f -o $*.s $<
+
+ifdef OPTIMIZE
+%.bc : %.st $(BUILD_OBJ_ROOT)/tools/Debug/stkrc
+ stkrc -e -o - $< | opt -stats -q -f -o $*.bc -adce -branch-combine -cee -constmerge -constprop -dce -die -gcse -globaldce -instcombine -pre
+else
+%.bc : %.st $(BUILD_OBJ_ROOT)/tools/Debug/stkrc
+ stkrc -e -f -o $*.bc $<
+endif
+
+%.ll : %.bc
+ llvm-dis -o $*.ll $<
+
+clean ::
+ rm -f $(TESTS)
+
+.SUFFIXES: .st .s .ll
+.PRECIOUS: %.s %.ll %.bc %.st
+.PHONY: test_each test_asm
diff --git a/projects/Stacker/test/abs.st b/projects/Stacker/test/abs.st
new file mode 100644
index 0000000000..8dde286a8b
--- /dev/null
+++ b/projects/Stacker/test/abs.st
@@ -0,0 +1,6 @@
+#
+# ABS test
+#
+FORWARD success;
+FORWARD failure;
+: MAIN -23 ABS 23 = IF success ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/add.st b/projects/Stacker/test/add.st
new file mode 100644
index 0000000000..89d5a9cb68
--- /dev/null
+++ b/projects/Stacker/test/add.st
@@ -0,0 +1,7 @@
+#
+# ADD test
+#
+FORWARD success;
+FORWARD failure;
+: step2 7 93 + 100 = IF success ELSE failure ENDIF ;
+: MAIN 93 7 + 100 = IF step2 ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/and.st b/projects/Stacker/test/and.st
new file mode 100644
index 0000000000..75b5919d79
--- /dev/null
+++ b/projects/Stacker/test/and.st
@@ -0,0 +1,7 @@
+#
+# AND test
+#
+FORWARD success;
+FORWARD failure;
+: step2 7 15 AND 7 = IF success ELSE failure ENDIF ;
+: MAIN 8 16 AND 0 = IF step2 ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/decr.st b/projects/Stacker/test/decr.st
new file mode 100644
index 0000000000..3244152e58
--- /dev/null
+++ b/projects/Stacker/test/decr.st
@@ -0,0 +1,6 @@
+#
+# DECR test
+#
+FORWARD success;
+FORWARD failure;
+: MAIN 8 -- 7 = IF success ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/div.st b/projects/Stacker/test/div.st
new file mode 100644
index 0000000000..dcffa5690f
--- /dev/null
+++ b/projects/Stacker/test/div.st
@@ -0,0 +1,6 @@
+#
+# DIV test
+#
+FORWARD success;
+FORWARD failure;
+: MAIN 7 49 / 7 = IF success ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/drop.st b/projects/Stacker/test/drop.st
new file mode 100644
index 0000000000..4e29ae0d48
--- /dev/null
+++ b/projects/Stacker/test/drop.st
@@ -0,0 +1,6 @@
+#
+# DROP test
+#
+FORWARD success;
+FORWARD failure;
+: MAIN 1 2 DROP 1 = IF success ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/drop2.st b/projects/Stacker/test/drop2.st
new file mode 100644
index 0000000000..f7e95a48ed
--- /dev/null
+++ b/projects/Stacker/test/drop2.st
@@ -0,0 +1,7 @@
+#
+# DROP2 test
+#
+FORWARD success;
+FORWARD failure;
+: step2 0 = IF success ELSE failure ENDIF ;
+: MAIN 0 1 2 3 DROP2 1 = IF step2 ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/dup.st b/projects/Stacker/test/dup.st
new file mode 100644
index 0000000000..0ddaa43c45
--- /dev/null
+++ b/projects/Stacker/test/dup.st
@@ -0,0 +1,8 @@
+#
+# DUP test
+#
+FORWARD success;
+FORWARD failure;
+: phase3 1 = IF success ELSE failure ENDIF ;
+: phase2 2 = IF phase3 ELSE failure ENDIF ;
+: MAIN 1 2 DUP 2 = IF phase2 ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/dup2.st b/projects/Stacker/test/dup2.st
new file mode 100644
index 0000000000..aed0132842
--- /dev/null
+++ b/projects/Stacker/test/dup2.st
@@ -0,0 +1,7 @@
+#
+# DUP2 test
+#
+FORWARD success;
+FORWARD failure;
+: phase2 1 = IF success ELSE failure ENDIF ;
+: MAIN 1 2 DUP2 2 = IF phase2 ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/eq.st b/projects/Stacker/test/eq.st
new file mode 100644
index 0000000000..59733af305
--- /dev/null
+++ b/projects/Stacker/test/eq.st
@@ -0,0 +1,6 @@
+#
+# EQ test
+#
+FORWARD success;
+FORWARD failure;
+: MAIN 17 17 = IF success ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/false.st b/projects/Stacker/test/false.st
new file mode 100644
index 0000000000..08c178362a
--- /dev/null
+++ b/projects/Stacker/test/false.st
@@ -0,0 +1,6 @@
+#
+# FALSE test
+#
+FORWARD success;
+FORWARD failure;
+: MAIN FALSE 0 = IF success ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/ge.st b/projects/Stacker/test/ge.st
new file mode 100644
index 0000000000..d303b773ae
--- /dev/null
+++ b/projects/Stacker/test/ge.st
@@ -0,0 +1,7 @@
+#
+# GE test
+#
+FORWARD success;
+FORWARD failure;
+: phase2 49 49 >= IF success ELSE failure ENDIF ;
+: MAIN 7 49 >= IF phase2 ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/gt.st b/projects/Stacker/test/gt.st
new file mode 100644
index 0000000000..e873b4e7cf
--- /dev/null
+++ b/projects/Stacker/test/gt.st
@@ -0,0 +1,6 @@
+#
+# GT test
+#
+FORWARD success;
+FORWARD failure;
+: MAIN 7 49 > IF success ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/incr.st b/projects/Stacker/test/incr.st
new file mode 100644
index 0000000000..c2f8e34536
--- /dev/null
+++ b/projects/Stacker/test/incr.st
@@ -0,0 +1,6 @@
+#
+# INCR test
+#
+FORWARD success;
+FORWARD failure;
+: MAIN 7 ++ 8 = IF success ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/le.st b/projects/Stacker/test/le.st
new file mode 100644
index 0000000000..d218db865f
--- /dev/null
+++ b/projects/Stacker/test/le.st
@@ -0,0 +1,7 @@
+#
+# LE test
+#
+FORWARD success;
+FORWARD failure;
+: phase2 49 49 <= IF success ELSE failure ENDIF ;
+: MAIN 49 7 <= IF phase2 ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/lt.st b/projects/Stacker/test/lt.st
new file mode 100644
index 0000000000..9752186160
--- /dev/null
+++ b/projects/Stacker/test/lt.st
@@ -0,0 +1,7 @@
+#
+# LT test
+#
+FORWARD success;
+FORWARD failure;
+: phase2 49 7 < IF success ELSE failure ENDIF ;
+: MAIN 7 49 < IF failure ELSE phase2 ENDIF ;
diff --git a/projects/Stacker/test/max.st b/projects/Stacker/test/max.st
new file mode 100644
index 0000000000..b3b905d040
--- /dev/null
+++ b/projects/Stacker/test/max.st
@@ -0,0 +1,7 @@
+#
+# MAX test
+#
+FORWARD success;
+FORWARD failure;
+: step2 2 1 MAX 2 = IF success ELSE failure ENDIF ;
+: MAIN 1 2 MAX 2 = IF step2 ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/memory.st b/projects/Stacker/test/memory.st
new file mode 100644
index 0000000000..8c59956a62
--- /dev/null
+++ b/projects/Stacker/test/memory.st
@@ -0,0 +1,10 @@
+#
+# MEMORY test
+#
+FORWARD success;
+FORWARD failure;
+: try_free FREE ;
+: read_space >s ;
+: write_space 0 72 PUT 1 69 PUT 2 76 PUT 3 76 PUT 4 79 PUT ;
+: try_malloc 64 MALLOC ;
+: MAIN try_malloc write_space read_space try_free " - " >s success ;
diff --git a/projects/Stacker/test/min.st b/projects/Stacker/test/min.st
new file mode 100644
index 0000000000..7f516057d6
--- /dev/null
+++ b/projects/Stacker/test/min.st
@@ -0,0 +1,7 @@
+#
+# MIN test
+#
+FORWARD success;
+FORWARD failure;
+: step2 1 2 MIN 1 = IF success ELSE failure ENDIF ;
+: MAIN 2 1 MIN 1 = IF step2 ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/mod.st b/projects/Stacker/test/mod.st
new file mode 100644
index 0000000000..5bb81dcab8
--- /dev/null
+++ b/projects/Stacker/test/mod.st
@@ -0,0 +1,6 @@
+#
+# MOD value test
+#
+FORWARD success;
+FORWARD failure;
+: MAIN 7 13 MOD 6 = IF success ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/mul.st b/projects/Stacker/test/mul.st
new file mode 100644
index 0000000000..5831458818
--- /dev/null
+++ b/projects/Stacker/test/mul.st
@@ -0,0 +1,6 @@
+#
+# MUL value test
+#
+FORWARD success;
+FORWARD failure;
+: MAIN 14 7 * 98 = IF success ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/ne.st b/projects/Stacker/test/ne.st
new file mode 100644
index 0000000000..dde9d010a5
--- /dev/null
+++ b/projects/Stacker/test/ne.st
@@ -0,0 +1,6 @@
+#
+# NE test
+#
+FORWARD success;
+FORWARD failure;
+: MAIN 7 49 <> IF success ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/neg.st b/projects/Stacker/test/neg.st
new file mode 100644
index 0000000000..d3d05be3d3
--- /dev/null
+++ b/projects/Stacker/test/neg.st
@@ -0,0 +1,6 @@
+#
+# NEG test
+#
+FORWARD success;
+FORWARD failure;
+: MAIN 23 NEG -23 = IF success ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/nip.st b/projects/Stacker/test/nip.st
new file mode 100644
index 0000000000..91da4b4018
--- /dev/null
+++ b/projects/Stacker/test/nip.st
@@ -0,0 +1,6 @@
+#
+# NIP test
+#
+FORWARD success;
+FORWARD failure;
+: MAIN 1 2 NIP 2 = IF success ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/nip2.st b/projects/Stacker/test/nip2.st
new file mode 100644
index 0000000000..a171028a80
--- /dev/null
+++ b/projects/Stacker/test/nip2.st
@@ -0,0 +1,9 @@
+#
+# NIP2 test
+#
+FORWARD success;
+FORWARD failure;
+: test_0 0 = IF success ELSE failure ENDIF ;
+: test_3 3 = IF test_0 ELSE failure ENDIF ;
+: test_4 4 = IF test_3 ELSE failure ENDIF ;
+: MAIN 0 1 2 3 4 NIP2 test_4 ;
diff --git a/projects/Stacker/test/or.st b/projects/Stacker/test/or.st
new file mode 100644
index 0000000000..60359070de
--- /dev/null
+++ b/projects/Stacker/test/or.st
@@ -0,0 +1,7 @@
+#
+# OR test
+#
+FORWARD success;
+FORWARD failure;
+: phase2 0 0 OR 0 = IF success ELSE failure ENDIF ;
+: MAIN 7 8 OR 15 = IF phase2 ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/out_chr.st b/projects/Stacker/test/out_chr.st
new file mode 100644
index 0000000000..54bd95846b
--- /dev/null
+++ b/projects/Stacker/test/out_chr.st
@@ -0,0 +1,5 @@
+#
+# OUT_CH test
+#
+FORWARD success;
+: MAIN 33 >c success ;
diff --git a/projects/Stacker/test/out_num.st b/projects/Stacker/test/out_num.st
new file mode 100644
index 0000000000..30ec9744b8
--- /dev/null
+++ b/projects/Stacker/test/out_num.st
@@ -0,0 +1,5 @@
+#
+# OUT_NUM test
+#
+FORWARD success;
+: MAIN 33 >d success ;
diff --git a/projects/Stacker/test/out_str.st b/projects/Stacker/test/out_str.st
new file mode 100644
index 0000000000..27d1659d00
--- /dev/null
+++ b/projects/Stacker/test/out_str.st
@@ -0,0 +1,5 @@
+#
+# OUT_STR test
+#
+FORWARD success;
+: MAIN "!" >s success ;
diff --git a/projects/Stacker/test/over.st b/projects/Stacker/test/over.st
new file mode 100644
index 0000000000..bec61a571f
--- /dev/null
+++ b/projects/Stacker/test/over.st
@@ -0,0 +1,9 @@
+#
+# OVER test
+#
+FORWARD success;
+FORWARD failure;
+: phase4 0 = IF success ELSE failure ENDIF ;
+: phase3 2 = IF phase4 ELSE failure ENDIF ;
+: phase2 1 = IF phase3 ELSE failure ENDIF ;
+: MAIN 0 2 1 OVER 2 = IF phase2 ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/over2.st b/projects/Stacker/test/over2.st
new file mode 100644
index 0000000000..cd4618aa0d
--- /dev/null
+++ b/projects/Stacker/test/over2.st
@@ -0,0 +1,14 @@
+#
+# OVER2 test
+#
+# Logic: // w1 w2 w3 w4 -- w1 w2 w3 w4 w1 w2
+#
+FORWARD success;
+FORWARD failure;
+: try_0 0 = IF success ELSE failure ENDIF ;
+: try_1b 1 = IF try_0 ELSE failure ENDIF ;
+: try_2 2 = IF try_1b ELSE failure ENDIF ;
+: try_3 3 = IF try_2 ELSE failure ENDIF ;
+: try_4 4 = IF try_3 ELSE failure ENDIF ;
+: try_1a 1 = IF try_4 ELSE failure ENDIF ;
+: MAIN 0 1 2 3 4 OVER2 2 = IF try_1a ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/pick.st b/projects/Stacker/test/pick.st
new file mode 100644
index 0000000000..b9670b1387
--- /dev/null
+++ b/projects/Stacker/test/pick.st
@@ -0,0 +1,9 @@
+#
+# PICK test
+#
+# Logic: // x0 ... Xn n -- x0 ... Xn x0
+#
+FORWARD success;
+FORWARD failure;
+: next 10 = IF success ELSE failure ENDIF ;
+: MAIN 0 1 2 3 4 5 6 7 8 9 10 5 PICK 5 = IF next ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/recurse.st b/projects/Stacker/test/recurse.st
new file mode 100644
index 0000000000..310728c071
--- /dev/null
+++ b/projects/Stacker/test/recurse.st
@@ -0,0 +1,7 @@
+#
+# RECURSE test
+#
+FORWARD success;
+FORWARD failure;
+: recurser 100 = IF 1 + RECURSE;
+: MAIN 1 recurser success ;
diff --git a/projects/Stacker/test/return.st b/projects/Stacker/test/return.st
new file mode 100644
index 0000000000..ab26942dcb
--- /dev/null
+++ b/projects/Stacker/test/return.st
@@ -0,0 +1,8 @@
+
+#
+# RECURSE test
+#
+FORWARD success;
+FORWARD failure;
+: returner 17 RETURN ;
+: MAIN returner 17 = IF success ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/roll.st b/projects/Stacker/test/roll.st
new file mode 100644
index 0000000000..1c203af1b9
--- /dev/null
+++ b/projects/Stacker/test/roll.st
@@ -0,0 +1,5 @@
+#
+# ROLL test
+#
+FORWARD success;
+: MAIN "Not Implemented Yet - Left As An Exercise - " >s success ;
diff --git a/projects/Stacker/test/rot.st b/projects/Stacker/test/rot.st
new file mode 100644
index 0000000000..75b1422ddc
--- /dev/null
+++ b/projects/Stacker/test/rot.st
@@ -0,0 +1,9 @@
+#
+# DUP test
+#
+FORWARD success;
+FORWARD failure;
+: phase4 0 = IF success ELSE failure ENDIF ;
+: phase3 2 = IF phase4 ELSE failure ENDIF ;
+: phase2 3 = IF phase3 ELSE failure ENDIF ;
+: MAIN 0 1 2 3 ROT 1 = IF phase2 ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/rot2.st b/projects/Stacker/test/rot2.st
new file mode 100644
index 0000000000..16bd1d6fda
--- /dev/null
+++ b/projects/Stacker/test/rot2.st
@@ -0,0 +1,14 @@
+#
+# ROT2 test
+#
+# Logic: // w1 w2 w3 w4 w5 w6 -- w3 w4 w5 w6 w1 w2
+#
+FORWARD success;
+FORWARD failure;
+: try_0 0 = IF success ELSE failure ENDIF ;
+: try_3 3 = IF try_0 ELSE failure ENDIF ;
+: try_4 4 = IF try_3 ELSE failure ENDIF ;
+: try_5 5 = IF try_4 ELSE failure ENDIF ;
+: try_6 6 = IF try_5 ELSE failure ENDIF ;
+: try_1 1 = IF try_6 ELSE failure ENDIF ;
+: MAIN 0 1 2 3 4 5 6 ROT2 2 = IF try_1 ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/rrot.st b/projects/Stacker/test/rrot.st
new file mode 100644
index 0000000000..afbf556500
--- /dev/null
+++ b/projects/Stacker/test/rrot.st
@@ -0,0 +1,12 @@
+#
+# RROT test
+#
+# Logic: w1 w2 w3 -- w3 w1 w2
+#
+FORWARD success;
+FORWARD failure;
+: try_0 0 = IF success ELSE failure ENDIF ;
+: try_3 3 = IF try_0 ELSE failure ENDIF ;
+: try_1 1 = IF try_3 ELSE failure ENDIF ;
+: MAIN 0 1 2 3 RROT 2 = IF try_1 ELSE failure ENDIF ;
+
diff --git a/projects/Stacker/test/rrot2.st b/projects/Stacker/test/rrot2.st
new file mode 100644
index 0000000000..fb2ebd1dd7
--- /dev/null
+++ b/projects/Stacker/test/rrot2.st
@@ -0,0 +1,14 @@
+#
+# RROT2 test
+#
+# Logic: // w1 w2 w3 w4 w5 w6 -- w5 w6 w1 w2 w3 w4
+#
+FORWARD success;
+FORWARD failure;
+: try_0 0 = IF success ELSE failure ENDIF ;
+: try_5 5 = IF try_0 ELSE failure ENDIF ;
+: try_6 6 = IF try_5 ELSE failure ENDIF ;
+: try_1 1 = IF try_6 ELSE failure ENDIF ;
+: try_2 2 = IF try_1 ELSE failure ENDIF ;
+: try_3 3 = IF try_2 ELSE failure ENDIF ;
+: MAIN 0 1 2 3 4 5 6 RROT2 4 = IF try_3 ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/select.st b/projects/Stacker/test/select.st
new file mode 100644
index 0000000000..8e3dfd0f2f
--- /dev/null
+++ b/projects/Stacker/test/select.st
@@ -0,0 +1,7 @@
+#
+# SELECT test
+#
+FORWARD success;
+FORWARD failure;
+: try_99 99 = IF success ELSE failure ENDIF ;
+: MAIN 99 10 9 8 7 6 5 4 3 2 1 10 5 SELECT 5 = IF try_99 ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/shl.st b/projects/Stacker/test/shl.st
new file mode 100644
index 0000000000..5919d286be
--- /dev/null
+++ b/projects/Stacker/test/shl.st
@@ -0,0 +1,7 @@
+#
+# SHL test
+#
+FORWARD success;
+FORWARD failure;
+: show_failure >d SPACE failure ;
+: MAIN 64 3 << 512 = IF success ELSE show_failure ENDIF ;
diff --git a/projects/Stacker/test/shr.st b/projects/Stacker/test/shr.st
new file mode 100644
index 0000000000..3dbc24e3ce
--- /dev/null
+++ b/projects/Stacker/test/shr.st
@@ -0,0 +1,7 @@
+#
+# SHR test
+#
+FORWARD success;
+FORWARD failure;
+: show_failure >d SPACE failure ;
+: MAIN 64 3 >> 8 = IF success ELSE show_failure ENDIF ;
diff --git a/projects/Stacker/test/space.st b/projects/Stacker/test/space.st
new file mode 100644
index 0000000000..26a068a79d
--- /dev/null
+++ b/projects/Stacker/test/space.st
@@ -0,0 +1,5 @@
+#
+# SPACE test
+#
+FORWARD success;
+: MAIN ">>" >s SPACE "<<" >s success ;
diff --git a/projects/Stacker/test/star_slash.st b/projects/Stacker/test/star_slash.st
new file mode 100644
index 0000000000..d353a7d504
--- /dev/null
+++ b/projects/Stacker/test/star_slash.st
@@ -0,0 +1,6 @@
+#
+# */ value test
+#
+FORWARD success;
+FORWARD failure;
+: MAIN 17 17 17 */ 17 = IF success ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/sub.st b/projects/Stacker/test/sub.st
new file mode 100644
index 0000000000..09438d15e1
--- /dev/null
+++ b/projects/Stacker/test/sub.st
@@ -0,0 +1,6 @@
+#
+# SUB test
+#
+FORWARD success;
+FORWARD failure;
+: MAIN 23 15 - -8 = IF success ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/swap.st b/projects/Stacker/test/swap.st
new file mode 100644
index 0000000000..14176dbd10
--- /dev/null
+++ b/projects/Stacker/test/swap.st
@@ -0,0 +1,9 @@
+
+#
+# DUP test
+#
+FORWARD success;
+FORWARD failure;
+: phase3 0 = IF success ELSE failure ENDIF ;
+: phase2 2 = IF phase3 ELSE failure ENDIF ;
+: MAIN 0 1 2 SWAP 1 = IF phase2 ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/swap2.st b/projects/Stacker/test/swap2.st
new file mode 100644
index 0000000000..c4f1bbd37d
--- /dev/null
+++ b/projects/Stacker/test/swap2.st
@@ -0,0 +1,10 @@
+#
+# SWAP2 test
+#
+FORWARD success;
+FORWARD failure;
+: try_0 0 = IF success ELSE failure ENDIF ;
+: try_3 3 = IF try_0 ELSE failure ENDIF ;
+: try_4 4 = IF try_3 ELSE failure ENDIF ;
+: try_1 1 = IF try_4 ELSE failure ENDIF ;
+: MAIN 0 1 2 3 4 SWAP2 2 = IF try_1 ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/tab.st b/projects/Stacker/test/tab.st
new file mode 100644
index 0000000000..b3b9e6e146
--- /dev/null
+++ b/projects/Stacker/test/tab.st
@@ -0,0 +1,5 @@
+#
+# TAB test
+#
+FORWARD success;
+: MAIN ">>" >s TAB "<<" >s success ;
diff --git a/projects/Stacker/test/testing.st b/projects/Stacker/test/testing.st
new file mode 100644
index 0000000000..a5e32be84c
--- /dev/null
+++ b/projects/Stacker/test/testing.st
@@ -0,0 +1,5 @@
+#
+# Common definitions for testing
+#
+: success "Success" >s CR 0 EXIT ;
+: failure "Failure" >s CR 1 EXIT ;
diff --git a/projects/Stacker/test/true.st b/projects/Stacker/test/true.st
new file mode 100644
index 0000000000..223e728fd5
--- /dev/null
+++ b/projects/Stacker/test/true.st
@@ -0,0 +1,6 @@
+#
+# TRUE test
+#
+FORWARD success;
+FORWARD failure;
+: MAIN TRUE -1 = IF success ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/tuck.st b/projects/Stacker/test/tuck.st
new file mode 100644
index 0000000000..956333ab4d
--- /dev/null
+++ b/projects/Stacker/test/tuck.st
@@ -0,0 +1,11 @@
+#
+# TUCK test
+#
+# Logic: // w1 w2 -- w2 w1 w2
+#
+FORWARD success;
+FORWARD failure;
+: try_0 0 = IF success ELSE failure ENDIF ;
+: try_2 2 = IF try_0 ELSE failure ENDIF ;
+: try_1 1 = IF try_2 ELSE failure ENDIF ;
+: MAIN 0 1 2 TUCK 2 = IF try_1 ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/tuck2.st b/projects/Stacker/test/tuck2.st
new file mode 100644
index 0000000000..e32dcc2798
--- /dev/null
+++ b/projects/Stacker/test/tuck2.st
@@ -0,0 +1,14 @@
+#
+# TUCK2 test
+#
+# Logic: // w1 w2 w3 w4 -- w3 w4 w1 w2 w3 w4
+#
+FORWARD success;
+FORWARD failure;
+: try_0 0 = IF success ELSE failure ENDIF ;
+: try_3b 3 = IF try_0 ELSE failure ENDIF ;
+: try_4 4 = IF try_3b ELSE failure ENDIF ;
+: try_1 1 = IF try_4 ELSE failure ENDIF ;
+: try_2 2 = IF try_1 ELSE failure ENDIF ;
+: try_3a 3 = IF try_2 ELSE failure ENDIF ;
+: MAIN 0 1 2 3 4 TUCK2 4 = IF try_3a ELSE failure ENDIF ;
diff --git a/projects/Stacker/test/while.st b/projects/Stacker/test/while.st
new file mode 100644
index 0000000000..7798f12e1f
--- /dev/null
+++ b/projects/Stacker/test/while.st
@@ -0,0 +1,8 @@
+#
+# WHILE test
+#
+FORWARD success;
+FORWARD failure;
+: body "." >s DROP -- ;
+: do_while WHILE body END ;
+: MAIN 20 do_while 0 = IF success ELSE failure ENDIF;
diff --git a/projects/Stacker/test/xor.st b/projects/Stacker/test/xor.st
new file mode 100644
index 0000000000..924d20a9e8
--- /dev/null
+++ b/projects/Stacker/test/xor.st
@@ -0,0 +1,6 @@
+#
+# XOR test
+#
+FORWARD success;
+FORWARD failure;
+: MAIN 7 3 XOR 4 = IF success ELSE failure ENDIF ;