summaryrefslogtreecommitdiff
path: root/tests/checkasm/aarch64
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2016-09-30 11:39:22 +0300
committerMartin Storsjö <martin@martin.st>2016-10-16 23:26:22 +0300
commitf1b3e131385176c3c9d9783b25047856a0dcebf6 (patch)
tree50890d5f995440e8b530acb9297b853d729c90ae /tests/checkasm/aarch64
parenta05cc56124b4f1237f6355784de821e3290ddb44 (diff)
checkasm: aarch64: Clobber the stack before calling functions
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'tests/checkasm/aarch64')
-rw-r--r--tests/checkasm/aarch64/checkasm.S13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/checkasm/aarch64/checkasm.S b/tests/checkasm/aarch64/checkasm.S
index 39e83372b7..c22204fa34 100644
--- a/tests/checkasm/aarch64/checkasm.S
+++ b/tests/checkasm/aarch64/checkasm.S
@@ -52,6 +52,19 @@ endconst
// max number of args used by any asm function.
#define MAX_ARGS 15
+#define CLOBBER_STACK ((8*MAX_ARGS + 15) & ~15)
+
+function checkasm_stack_clobber, export=1
+ mov x29, sp
+ mov x2, #CLOBBER_STACK
+1:
+ stp x0, x1, [sp, #-16]!
+ subs x2, x2, #16
+ b.gt 1b
+ mov sp, x29
+ ret
+endfunc
+
#define ARG_STACK ((8*(MAX_ARGS - 8) + 15) & ~15)
function checkasm_checked_call, export=1