summaryrefslogtreecommitdiff
path: root/lisc/test
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-08-25 12:00:53 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-15 23:01:32 -0400
commit81b25dbe0b11e07c023a76912f72219e34ba9c19 (patch)
treeab5ac886dfab5d5755eb13aec95ba29a705bf10b /lisc/test
parent3920ee9951cf3e6a36ea098ec43680980c1c50a3 (diff)
downloadroux-81b25dbe0b11e07c023a76912f72219e34ba9c19.tar.gz
add the first generated test!
Diffstat (limited to 'lisc/test')
-rw-r--r--lisc/test/cprime.ssa68
1 files changed, 68 insertions, 0 deletions
diff --git a/lisc/test/cprime.ssa b/lisc/test/cprime.ssa
new file mode 100644
index 0000000..dbc2f72
--- /dev/null
+++ b/lisc/test/cprime.ssa
@@ -0,0 +1,68 @@
+@start
+ %v0 =l alloc8 4
+ %v1 =l alloc8 4
+ %v2 =l alloc8 4
+ %v3 =l alloc8 4
+ %v4 =l alloc8 4
+ storew 5, %v1
+ storew 11, %v2
+ storew 12, %v3
+@L0
+ %v5 =w load %v1
+ %v6 =w cne %v5, 10001
+ jnz %v6, @L8, @L1
+@L8
+ storew 1, %v4
+ %v7 =w load %v3
+ %v8 =w rem %v7, 2
+ %v9 =w ceq %v8, 0
+ jnz %v9, @L9, @L5
+@L9
+ storew 0, %v4
+@L5
+ storew 3, %v0
+@L2
+ %v10 =w load %v0
+ %v11 =w load %v3
+ %v12 =w cslt %v10, %v11
+ jnz %v12, @L10, @L3
+@L10
+ %v13 =w load %v3
+ %v14 =w load %v0
+ %v15 =w rem %v13, %v14
+ %v16 =w ceq %v15, 0
+ jnz %v16, @L11, @L4
+@L11
+ storew 0, %v4
+ jmp @L3
+@L4
+ %v17 =w load %v0
+ %v18 =w add %v17, 2
+ storew %v18, %v0
+ jmp @L2
+@L3
+ %v19 =w load %v4
+ jnz %v19, @L12, @L6
+@L12
+ %v20 =w load %v3
+ storew %v20, %v2
+ %v21 =w load %v1
+ %v22 =w add %v21, 1
+ storew %v22, %v1
+@L6
+ %v23 =w load %v3
+ %v24 =w add %v23, 1
+ storew %v24, %v3
+ jmp @L0
+@L1
+ %v25 =w load %v2
+ %v26 =w cne %v25, 104743
+ jnz %v26, @L13, @L7
+@L13
+ storew 1, $a
+ ret
+@L7
+ storew 0, $a
+ ret
+@end
+ ret