summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-03-05 08:19:04 -0500
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-03-05 08:19:06 -0500
commit6deb301f3eeec3061da7fb72996023187b98463f (patch)
treecc749c2bedbd025fe4e0ccba00d5836cc0ee7da7
parent8a87b3f1ffe54df5b53cca9ae2d02250031c0afe (diff)
downloadroux-6deb301f3eeec3061da7fb72996023187b98463f.tar.gz
new abi test, driver is to do
-rw-r--r--lisc/test/abi3.ssa31
1 files changed, 31 insertions, 0 deletions
diff --git a/lisc/test/abi3.ssa b/lisc/test/abi3.ssa
new file mode 100644
index 0000000..0755783
--- /dev/null
+++ b/lisc/test/abi3.ssa
@@ -0,0 +1,31 @@
+
+# l is for long word (64bits)
+# w is for word (32bits)
+# h is for half word (16bits)
+# b is for byte (8bits)
+
+type :four = {l, b, w}
+
+function $test() {
+ @start
+ %y =w copy 0
+
+ %s =l alloc8 16 # allocate a :four struct
+ %s1 =l add %s, 12 # get address of the w
+ storel 3, %s # set the l
+ storew 4, %s1 # set the w
+
+ # function call with the above :four
+ # struct as first argument and 5 int
+ # arguments
+
+ %f =l copy $F
+ %x =w call %f(w %y, w 1, w 2, :four %s, w 5, w 6)
+
+ # store the result in the
+ # global variable a
+
+ %x1 =w add %y, %x
+ storew %x1, $a
+ ret
+}