summaryrefslogtreecommitdiff
path: root/test/llvm_autogenerated/non-executable-stack.wast
diff options
context:
space:
mode:
authorjgravelle-google <jgravelle@google.com>2017-06-05 09:34:15 -0700
committerGitHub <noreply@github.com>2017-06-05 09:34:15 -0700
commit3f0db5a7aafaaa4de713ff3ba3c3bbeb59fe566e (patch)
tree17ff1b4155b6ce4c01c7911e20a406df910bec3f /test/llvm_autogenerated/non-executable-stack.wast
parent4eb81f6cf14b02e77f84f6a5a89d926d4eac535f (diff)
downloadbinaryen-3f0db5a7aafaaa4de713ff3ba3c3bbeb59fe566e.tar.gz
binaryen-3f0db5a7aafaaa4de713ff3ba3c3bbeb59fe566e.tar.bz2
binaryen-3f0db5a7aafaaa4de713ff3ba3c3bbeb59fe566e.zip
S2wasm runtime funcs (#1027)
* Generate stackSave function in s2wasm * Generate stackAlloc in s2wasm * Generate stackRestore in s2wasm * Update dot_s tests for runtime functions * Add s2wasm check for exporting runtime functions * Fix flake8 for s2wasm.py * Rename wasmBuilder to builder
Diffstat (limited to 'test/llvm_autogenerated/non-executable-stack.wast')
-rw-r--r--test/llvm_autogenerated/non-executable-stack.wast36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/llvm_autogenerated/non-executable-stack.wast b/test/llvm_autogenerated/non-executable-stack.wast
index 6b7e830a9..071206e3b 100644
--- a/test/llvm_autogenerated/non-executable-stack.wast
+++ b/test/llvm_autogenerated/non-executable-stack.wast
@@ -2,5 +2,41 @@
(import "env" "memory" (memory $0 1))
(table 0 anyfunc)
(data (i32.const 4) "\10\04\00\00")
+ (export "stackSave" (func $stackSave))
+ (export "stackAlloc" (func $stackAlloc))
+ (export "stackRestore" (func $stackRestore))
+ (func $stackSave (result i32)
+ (i32.load offset=4
+ (i32.const 0)
+ )
+ )
+ (func $stackAlloc (param $0 i32) (result i32)
+ (local $1 i32)
+ (set_local $1
+ (i32.load offset=4
+ (i32.const 0)
+ )
+ )
+ (i32.store offset=4
+ (i32.const 0)
+ (i32.and
+ (i32.add
+ (i32.add
+ (get_local $1)
+ (get_local $0)
+ )
+ (i32.const 15)
+ )
+ (i32.const -16)
+ )
+ )
+ (get_local $1)
+ )
+ (func $stackRestore (param $0 i32)
+ (i32.store offset=4
+ (i32.const 0)
+ (get_local $0)
+ )
+ )
)
;; METADATA: { "asmConsts": {},"staticBump": 1040, "initializers": [] }