From a3e217c58fa4f9e065d68ad546f2f470e85fc511 Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 3 Jul 2015 15:11:36 -0400 Subject: add a sample program --- lisc/test/loop.ssa | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 lisc/test/loop.ssa (limited to 'lisc/test') 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 -- cgit 1.4.1