summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-12-28 11:44:06 -0800
committerOri Bernstein <ori@eigenstate.org>2015-12-28 11:44:32 -0800
commit75e90d91c0c50fb64812e61c21da8cbc8f1d3e5e (patch)
treebb54318881e64c7a3c8ebcacf6559e4cba00e741 /test
parentd710ee583d7591cfaba91d7ee39676dbcae1a116 (diff)
downloadmc-75e90d91c0c50fb64812e61c21da8cbc8f1d3e5e.tar.gz
Fix alignment in argument passing.
The alignment of a compound type is equal to the maximum alignment of its members, so your array shouldn't be aligned. When setting up arguments, though, I was accidentally using the size of the type instead of the alignment. Fixes #30
Diffstat (limited to 'test')
-rw-r--r--test/arraypass.myr12
-rw-r--r--test/tests1
2 files changed, 13 insertions, 0 deletions
diff --git a/test/arraypass.myr b/test/arraypass.myr
new file mode 100644
index 0000000..2804b4b
--- /dev/null
+++ b/test/arraypass.myr
@@ -0,0 +1,12 @@
+use std
+
+const keq = {a, b
+ std.put("{}\n", b[0])
+}
+
+const main = {args : byte[:][:]
+ var k : byte[5]
+
+ k = [1,2,3,4,5]
+ keq(k, k)
+}
diff --git a/test/tests b/test/tests
index 4753f91..8dc684f 100644
--- a/test/tests
+++ b/test/tests
@@ -115,6 +115,7 @@ B matchbind E 8
F matchmixed
B bigliteral P 34359738368
B arraylit-ni E 2
+B arraypass P 1
B livearraylit E 21
# B arraylit E 3 ## BUGGERED
B structlit E 42