[llvm-commits] CVS: llvm/projects/Stacker/test/Makefile abs.st add.st and.st decr.st div.st drop.st drop2.st dup.st dup2.st eq.st false.st ge.st gt.st incr.st le.st lt.st max.st memory.st min.st mod.st mul.st ne.st neg.st nip.st nip2.st or.st out_chr.st out_num.st out_str.st over.st over2.st pick.st recurse.st return.st roll.st rot.st rot2.st rrot.st rrot2.st select.st shl.st shr.st space.st star_slash.st sub.st swap.st swap2.st tab.st testing.st true.st tuck.st tuck2.st while.st xor.st

Chris Lattner lattner at cs.uiuc.edu
Sun Nov 23 12:13:01 PST 2003


Changes in directory llvm/projects/Stacker/test:

Makefile added (r1.1)
abs.st added (r1.1)
add.st added (r1.1)
and.st added (r1.1)
decr.st added (r1.1)
div.st added (r1.1)
drop.st added (r1.1)
drop2.st added (r1.1)
dup.st added (r1.1)
dup2.st added (r1.1)
eq.st added (r1.1)
false.st added (r1.1)
ge.st added (r1.1)
gt.st added (r1.1)
incr.st added (r1.1)
le.st added (r1.1)
lt.st added (r1.1)
max.st added (r1.1)
memory.st added (r1.1)
min.st added (r1.1)
mod.st added (r1.1)
mul.st added (r1.1)
ne.st added (r1.1)
neg.st added (r1.1)
nip.st added (r1.1)
nip2.st added (r1.1)
or.st added (r1.1)
out_chr.st added (r1.1)
out_num.st added (r1.1)
out_str.st added (r1.1)
over.st added (r1.1)
over2.st added (r1.1)
pick.st added (r1.1)
recurse.st added (r1.1)
return.st added (r1.1)
roll.st added (r1.1)
rot.st added (r1.1)
rot2.st added (r1.1)
rrot.st added (r1.1)
rrot2.st added (r1.1)
select.st added (r1.1)
shl.st added (r1.1)
shr.st added (r1.1)
space.st added (r1.1)
star_slash.st added (r1.1)
sub.st added (r1.1)
swap.st added (r1.1)
swap2.st added (r1.1)
tab.st added (r1.1)
testing.st added (r1.1)
true.st added (r1.1)
tuck.st added (r1.1)
tuck2.st added (r1.1)
while.st added (r1.1)
xor.st added (r1.1)

---
Log message:

Checkin tests


---
Diffs of the changes:  (+464 -0)

Index: llvm/projects/Stacker/test/Makefile
diff -c /dev/null llvm/projects/Stacker/test/Makefile:1.1
*** /dev/null	Sun Nov 23 12:12:32 2003
--- llvm/projects/Stacker/test/Makefile	Sun Nov 23 12:12:22 2003
***************
*** 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


Index: llvm/projects/Stacker/test/abs.st
diff -c /dev/null llvm/projects/Stacker/test/abs.st:1.1
*** /dev/null	Sun Nov 23 12:12:32 2003
--- llvm/projects/Stacker/test/abs.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,6 ----
+ #
+ # ABS test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : MAIN -23 ABS 23 = IF success ELSE failure ENDIF ;


Index: llvm/projects/Stacker/test/add.st
diff -c /dev/null llvm/projects/Stacker/test/add.st:1.1
*** /dev/null	Sun Nov 23 12:12:32 2003
--- llvm/projects/Stacker/test/add.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/and.st
diff -c /dev/null llvm/projects/Stacker/test/and.st:1.1
*** /dev/null	Sun Nov 23 12:12:32 2003
--- llvm/projects/Stacker/test/and.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/decr.st
diff -c /dev/null llvm/projects/Stacker/test/decr.st:1.1
*** /dev/null	Sun Nov 23 12:12:32 2003
--- llvm/projects/Stacker/test/decr.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,6 ----
+ #
+ # DECR test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : MAIN 8 -- 7 = IF success ELSE failure ENDIF ;


Index: llvm/projects/Stacker/test/div.st
diff -c /dev/null llvm/projects/Stacker/test/div.st:1.1
*** /dev/null	Sun Nov 23 12:12:32 2003
--- llvm/projects/Stacker/test/div.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,6 ----
+ #
+ # DIV test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : MAIN 7 49 / 7 = IF success ELSE failure ENDIF ;


Index: llvm/projects/Stacker/test/drop.st
diff -c /dev/null llvm/projects/Stacker/test/drop.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/drop.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,6 ----
+ #
+ # DROP test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : MAIN 1 2 DROP 1 = IF success ELSE failure ENDIF ;


Index: llvm/projects/Stacker/test/drop2.st
diff -c /dev/null llvm/projects/Stacker/test/drop2.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/drop2.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/dup.st
diff -c /dev/null llvm/projects/Stacker/test/dup.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/dup.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/dup2.st
diff -c /dev/null llvm/projects/Stacker/test/dup2.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/dup2.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/eq.st
diff -c /dev/null llvm/projects/Stacker/test/eq.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/eq.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,6 ----
+ #
+ # EQ test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : MAIN 17 17 = IF success ELSE failure ENDIF ;


Index: llvm/projects/Stacker/test/false.st
diff -c /dev/null llvm/projects/Stacker/test/false.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/false.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,6 ----
+ #
+ # FALSE test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : MAIN FALSE 0 = IF success ELSE failure ENDIF ;


Index: llvm/projects/Stacker/test/ge.st
diff -c /dev/null llvm/projects/Stacker/test/ge.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/ge.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/gt.st
diff -c /dev/null llvm/projects/Stacker/test/gt.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/gt.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,6 ----
+ #
+ # GT test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : MAIN 7 49 > IF success ELSE failure ENDIF ;


Index: llvm/projects/Stacker/test/incr.st
diff -c /dev/null llvm/projects/Stacker/test/incr.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/incr.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,6 ----
+ #
+ # INCR test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : MAIN 7 ++ 8 = IF success ELSE failure ENDIF ;


Index: llvm/projects/Stacker/test/le.st
diff -c /dev/null llvm/projects/Stacker/test/le.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/le.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/lt.st
diff -c /dev/null llvm/projects/Stacker/test/lt.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/lt.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/max.st
diff -c /dev/null llvm/projects/Stacker/test/max.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/max.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/memory.st
diff -c /dev/null llvm/projects/Stacker/test/memory.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/memory.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/min.st
diff -c /dev/null llvm/projects/Stacker/test/min.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/min.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/mod.st
diff -c /dev/null llvm/projects/Stacker/test/mod.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/mod.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,6 ----
+ #
+ # MOD value test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : MAIN 7 13 MOD 6 = IF success ELSE failure ENDIF ;


Index: llvm/projects/Stacker/test/mul.st
diff -c /dev/null llvm/projects/Stacker/test/mul.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/mul.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,6 ----
+ #
+ # MUL value test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : MAIN 14 7 * 98 = IF success ELSE failure ENDIF ;


Index: llvm/projects/Stacker/test/ne.st
diff -c /dev/null llvm/projects/Stacker/test/ne.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/ne.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,6 ----
+ #
+ # NE test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : MAIN 7 49 <> IF success ELSE failure ENDIF ;


Index: llvm/projects/Stacker/test/neg.st
diff -c /dev/null llvm/projects/Stacker/test/neg.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/neg.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,6 ----
+ #
+ # NEG test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : MAIN 23 NEG -23 = IF success ELSE failure ENDIF ;


Index: llvm/projects/Stacker/test/nip.st
diff -c /dev/null llvm/projects/Stacker/test/nip.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/nip.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,6 ----
+ #
+ # NIP test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : MAIN 1 2 NIP 2 = IF success ELSE failure ENDIF ;


Index: llvm/projects/Stacker/test/nip2.st
diff -c /dev/null llvm/projects/Stacker/test/nip2.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/nip2.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ; 


Index: llvm/projects/Stacker/test/or.st
diff -c /dev/null llvm/projects/Stacker/test/or.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/or.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/out_chr.st
diff -c /dev/null llvm/projects/Stacker/test/out_chr.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/out_chr.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,5 ----
+ #
+ # OUT_CH test
+ #
+ FORWARD success;
+ : MAIN 33 >c success ;


Index: llvm/projects/Stacker/test/out_num.st
diff -c /dev/null llvm/projects/Stacker/test/out_num.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/out_num.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,5 ----
+ #
+ # OUT_NUM test
+ #
+ FORWARD success;
+ : MAIN 33 >d success ;


Index: llvm/projects/Stacker/test/out_str.st
diff -c /dev/null llvm/projects/Stacker/test/out_str.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/out_str.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,5 ----
+ #
+ # OUT_STR test
+ #
+ FORWARD success;
+ : MAIN "!" >s success ;


Index: llvm/projects/Stacker/test/over.st
diff -c /dev/null llvm/projects/Stacker/test/over.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/over.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/over2.st
diff -c /dev/null llvm/projects/Stacker/test/over2.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/over2.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/pick.st
diff -c /dev/null llvm/projects/Stacker/test/pick.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/pick.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/recurse.st
diff -c /dev/null llvm/projects/Stacker/test/recurse.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/recurse.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,7 ----
+ #
+ # RECURSE test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : recurser 100 = IF 1 + RECURSE;
+ : MAIN 1 recurser success ;


Index: llvm/projects/Stacker/test/return.st
diff -c /dev/null llvm/projects/Stacker/test/return.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/return.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,8 ----
+ 
+ #
+ # RECURSE test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : returner 17 RETURN ;
+ : MAIN returner 17 = IF success ELSE failure ENDIF ;


Index: llvm/projects/Stacker/test/roll.st
diff -c /dev/null llvm/projects/Stacker/test/roll.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/roll.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,5 ----
+ #
+ # ROLL test
+ #
+ FORWARD success;
+ : MAIN "Not Implemented Yet - Left As An Exercise - " >s success ;


Index: llvm/projects/Stacker/test/rot.st
diff -c /dev/null llvm/projects/Stacker/test/rot.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/rot.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/rot2.st
diff -c /dev/null llvm/projects/Stacker/test/rot2.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/rot2.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/rrot.st
diff -c /dev/null llvm/projects/Stacker/test/rrot.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/rrot.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;
+ 


Index: llvm/projects/Stacker/test/rrot2.st
diff -c /dev/null llvm/projects/Stacker/test/rrot2.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/rrot2.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/select.st
diff -c /dev/null llvm/projects/Stacker/test/select.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/select.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/shl.st
diff -c /dev/null llvm/projects/Stacker/test/shl.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/shl.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,7 ----
+ #
+ # SHL test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : show_failure >d SPACE failure ;
+ : MAIN 64 3 << 512 = IF success ELSE show_failure ENDIF ;


Index: llvm/projects/Stacker/test/shr.st
diff -c /dev/null llvm/projects/Stacker/test/shr.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/shr.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,7 ----
+ #
+ # SHR test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : show_failure >d SPACE failure ;
+ : MAIN 64 3 >> 8 = IF success ELSE show_failure ENDIF ;


Index: llvm/projects/Stacker/test/space.st
diff -c /dev/null llvm/projects/Stacker/test/space.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/space.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,5 ----
+ #
+ # SPACE test
+ #
+ FORWARD success;
+ : MAIN ">>" >s SPACE "<<" >s success ; 


Index: llvm/projects/Stacker/test/star_slash.st
diff -c /dev/null llvm/projects/Stacker/test/star_slash.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/star_slash.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,6 ----
+ #
+ # */ value test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : MAIN 17 17 17 */ 17 = IF success ELSE failure ENDIF ;


Index: llvm/projects/Stacker/test/sub.st
diff -c /dev/null llvm/projects/Stacker/test/sub.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/sub.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,6 ----
+ #
+ # SUB test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : MAIN 23 15 - -8 = IF success ELSE failure ENDIF ;


Index: llvm/projects/Stacker/test/swap.st
diff -c /dev/null llvm/projects/Stacker/test/swap.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/swap.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/swap2.st
diff -c /dev/null llvm/projects/Stacker/test/swap2.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/swap2.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/tab.st
diff -c /dev/null llvm/projects/Stacker/test/tab.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/tab.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,5 ----
+ #
+ # TAB test
+ #
+ FORWARD success;
+ : MAIN ">>" >s TAB "<<" >s success ; 


Index: llvm/projects/Stacker/test/testing.st
diff -c /dev/null llvm/projects/Stacker/test/testing.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/testing.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,5 ----
+ #
+ # Common definitions for testing
+ #
+ : success "Success" >s CR 0 EXIT ;
+ : failure "Failure" >s CR 1 EXIT ;


Index: llvm/projects/Stacker/test/true.st
diff -c /dev/null llvm/projects/Stacker/test/true.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/true.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,6 ----
+ #
+ # TRUE test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : MAIN TRUE -1 = IF success ELSE failure ENDIF ;


Index: llvm/projects/Stacker/test/tuck.st
diff -c /dev/null llvm/projects/Stacker/test/tuck.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/tuck.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/tuck2.st
diff -c /dev/null llvm/projects/Stacker/test/tuck2.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/tuck2.st	Sun Nov 23 12:12:22 2003
***************
*** 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 ;


Index: llvm/projects/Stacker/test/while.st
diff -c /dev/null llvm/projects/Stacker/test/while.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/while.st	Sun Nov 23 12:12:22 2003
***************
*** 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;


Index: llvm/projects/Stacker/test/xor.st
diff -c /dev/null llvm/projects/Stacker/test/xor.st:1.1
*** /dev/null	Sun Nov 23 12:12:33 2003
--- llvm/projects/Stacker/test/xor.st	Sun Nov 23 12:12:22 2003
***************
*** 0 ****
--- 1,6 ----
+ #
+ # XOR test
+ #
+ FORWARD success;
+ FORWARD failure;
+ : MAIN 7 3 XOR 4 = IF success ELSE failure ENDIF ;





More information about the llvm-commits mailing list