summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-07-03 15:11:36 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-15 23:01:27 -0400
commita3e217c58fa4f9e065d68ad546f2f470e85fc511 (patch)
tree56e2e2ff03c6bc24d695e8aa1e7fa5bcd6eb323f
parenta40982bb2a9572c242dfdc4192d552ed8f805da5 (diff)
downloadroux-a3e217c58fa4f9e065d68ad546f2f470e85fc511.tar.gz
add a sample program
-rw-r--r--lisc/test/loop.ssa19
1 files changed, 19 insertions, 0 deletions
diff --git a/lisc/test/loop.ssa b/lisc/test/loop.ssa
new file mode 100644
index 0000000..6fea1c6
--- /dev/null
+++ b/lisc/test/loop.ssa
@@ -0,0 +1,19 @@
+# simple looping program
+# sums all integers from 100 to 0
+
+
+@start
+	%n0 = copy 100
+	%s0 = copy 0
+
+@loop
+	%s  = phi %s0, %s1
+	%n  = phi %n0, %n1
+
+	%n1 = sub %n, 1
+	%s1 = add %s, %n
+
+	cnd %n1, @end, @loop
+
+@end
+	ret