summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin@c9x.me>2017-04-08 21:40:39 -0400
committerQuentin Carbonneaux <quentin@c9x.me>2017-04-08 22:10:01 -0400
commitf4ddc9e54ed589b8d168cd39ebf2a5572b32431b (patch)
tree2d039c10d5ab9d17c1274fbffd75d793a3e3b1ad
parente4bc35149cc790e3ad034f6643f75c33765b142c (diff)
downloadroux-f4ddc9e54ed589b8d168cd39ebf2a5572b32431b.tar.gz
enable arm64 tests
The vararg tests had to be changed because
va_list is 32-bit wide on arm.  The astute
reader will notice that the way we pass
va_list values is wrong, we should be using
the ':valist' type as defined below instead
of 'l'.  But eh, that works for now, because
of the ABI.

    type :valist = align 8 { 32 }
-rw-r--r--Makefile5
-rw-r--r--test/dark.ssa1
-rw-r--r--test/vararg1.ssa4
-rw-r--r--test/vararg2.ssa28
4 files changed, 21 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index 45e4b50..6fc7d07 100644
--- a/Makefile
+++ b/Makefile
@@ -69,6 +69,9 @@ clean-gen: clean
 check: $(OBJDIR)/$(BIN)
 	tools/test.sh all
 
+check-arm64: $(OBJDIR)/$(BIN)
+	TARGET=arm64 tools/test.sh all
+
 80:
 	@for F in $(SRCALL);                       \
 	do                                         \
@@ -79,4 +82,4 @@ check: $(OBJDIR)/$(BIN)
 		}" < $$F;                          \
 	done
 
-.PHONY: clean clean-gen check 80 install uninstall
+.PHONY: clean clean-gen check check-arm64 80 install uninstall
diff --git a/test/dark.ssa b/test/dark.ssa
index 373b1b1..a1b2e60 100644
--- a/test/dark.ssa
+++ b/test/dark.ssa
@@ -1,3 +1,4 @@
+# skip arm64
 # a hack example,
 # we use a dark type to get
 # a pointer to the stack.
diff --git a/test/vararg1.ssa b/test/vararg1.ssa
index 28b3d0e..393743c 100644
--- a/test/vararg1.ssa
+++ b/test/vararg1.ssa
@@ -1,7 +1,7 @@
 export
 function d $f(l %x, ...) {
 @start
-	%vp =l alloc8 24
+	%vp =l alloc8 32
 	vastart %vp
 	%i =l vaarg %vp
 	%n =d vaarg %vp
@@ -11,7 +11,7 @@ function d $f(l %x, ...) {
 export
 function w $g(l %fmt, ...) {
 @start
-	%vp =l alloc8 24
+	%vp =l alloc8 32
 	vastart %vp
 	%r =w call $vprintf(l %fmt, l %vp)
 	ret %r
diff --git a/test/vararg2.ssa b/test/vararg2.ssa
index 7f72acb..5ad057a 100644
--- a/test/vararg2.ssa
+++ b/test/vararg2.ssa
@@ -6,7 +6,7 @@ export function $qbeprint0(l %fmt, ...) {
 	storew 2122789, %fmtint
 	storew 2123557, %fmtdbl
 	storew 0, %emptys
-	%vp =l alloc8 24
+	%vp =l alloc8 32
 	%fmt1 =l add 1, %fmt
 	vastart %vp
 @loop
@@ -32,7 +32,7 @@ export function $qbeprint0(l %fmt, ...) {
 
 export function $qbecall0(l %fmt, ...) {
 @start
-	%vp =l alloc8 24
+	%vp =l alloc8 32
 	vastart %vp
 	call $vprintf(l %fmt, l %vp)
 	ret
@@ -46,7 +46,7 @@ export function $qbeprint1(w %argw0, l %fmt, ...) {
 	storew 2122789, %fmtint
 	storew 2123557, %fmtdbl
 	storew 0, %emptys
-	%vp =l alloc8 24
+	%vp =l alloc8 32
 	%fmt1 =l add 1, %fmt
 	vastart %vp
 @loop
@@ -72,7 +72,7 @@ export function $qbeprint1(w %argw0, l %fmt, ...) {
 
 export function $qbecall1(w %argw0, l %fmt, ...) {
 @start
-	%vp =l alloc8 24
+	%vp =l alloc8 32
 	vastart %vp
 	call $vprintf(l %fmt, l %vp)
 	ret
@@ -86,7 +86,7 @@ export function $qbeprint2(d %argd0, l %fmt, ...) {
 	storew 2122789, %fmtint
 	storew 2123557, %fmtdbl
 	storew 0, %emptys
-	%vp =l alloc8 24
+	%vp =l alloc8 32
 	%fmt1 =l add 1, %fmt
 	vastart %vp
 @loop
@@ -112,7 +112,7 @@ export function $qbeprint2(d %argd0, l %fmt, ...) {
 
 export function $qbecall2(d %argd0, l %fmt, ...) {
 @start
-	%vp =l alloc8 24
+	%vp =l alloc8 32
 	vastart %vp
 	call $vprintf(l %fmt, l %vp)
 	ret
@@ -126,7 +126,7 @@ export function $qbeprint3(w %argw0, w %argw1, w %argw2, w %argw3, l %fmt, ...)
 	storew 2122789, %fmtint
 	storew 2123557, %fmtdbl
 	storew 0, %emptys
-	%vp =l alloc8 24
+	%vp =l alloc8 32
 	%fmt1 =l add 1, %fmt
 	vastart %vp
 @loop
@@ -152,7 +152,7 @@ export function $qbeprint3(w %argw0, w %argw1, w %argw2, w %argw3, l %fmt, ...)
 
 export function $qbecall3(w %argw0, w %argw1, w %argw2, w %argw3, l %fmt, ...) {
 @start
-	%vp =l alloc8 24
+	%vp =l alloc8 32
 	vastart %vp
 	call $vprintf(l %fmt, l %vp)
 	ret
@@ -166,7 +166,7 @@ export function $qbeprint4(d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d %
 	storew 2122789, %fmtint
 	storew 2123557, %fmtdbl
 	storew 0, %emptys
-	%vp =l alloc8 24
+	%vp =l alloc8 32
 	%fmt1 =l add 1, %fmt
 	vastart %vp
 @loop
@@ -192,7 +192,7 @@ export function $qbeprint4(d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d %
 
 export function $qbecall4(d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d %argd5, l %fmt, ...) {
 @start
-	%vp =l alloc8 24
+	%vp =l alloc8 32
 	vastart %vp
 	call $vprintf(l %fmt, l %vp)
 	ret
@@ -206,7 +206,7 @@ export function $qbeprint5(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, d %
 	storew 2122789, %fmtint
 	storew 2123557, %fmtdbl
 	storew 0, %emptys
-	%vp =l alloc8 24
+	%vp =l alloc8 32
 	%fmt1 =l add 1, %fmt
 	vastart %vp
 @loop
@@ -232,7 +232,7 @@ export function $qbeprint5(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, d %
 
 export function $qbecall5(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d %argd5, d %argd6, l %fmt, ...) {
 @start
-	%vp =l alloc8 24
+	%vp =l alloc8 32
 	vastart %vp
 	call $vprintf(l %fmt, l %vp)
 	ret
@@ -246,7 +246,7 @@ export function $qbeprint6(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, w %
 	storew 2122789, %fmtint
 	storew 2123557, %fmtdbl
 	storew 0, %emptys
-	%vp =l alloc8 24
+	%vp =l alloc8 32
 	%fmt1 =l add 1, %fmt
 	vastart %vp
 @loop
@@ -272,7 +272,7 @@ export function $qbeprint6(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, w %
 
 export function $qbecall6(w %argw0, w %argw1, w %argw2, w %argw3, w %argw4, w %argw5, w %argw6, w %argw7, w %argw8, w %argw9, d %argd0, d %argd1, d %argd2, d %argd3, d %argd4, d %argd5, d %argd6, d %argd7, d %argd8, d %argd9, l %fmt, ...) {
 @start
-	%vp =l alloc8 24
+	%vp =l alloc8 32
 	vastart %vp
 	call $vprintf(l %fmt, l %vp)
 	ret