diff options
author | jgravelle-google <jgravelle@google.com> | 2017-06-05 09:34:15 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-05 09:34:15 -0700 |
commit | 3f0db5a7aafaaa4de713ff3ba3c3bbeb59fe566e (patch) | |
tree | 17ff1b4155b6ce4c01c7911e20a406df910bec3f /test/dot_s/function-data-sections.wast | |
parent | 4eb81f6cf14b02e77f84f6a5a89d926d4eac535f (diff) | |
download | binaryen-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/dot_s/function-data-sections.wast')
-rw-r--r-- | test/dot_s/function-data-sections.wast | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/dot_s/function-data-sections.wast b/test/dot_s/function-data-sections.wast index 690d9e56c..64a7a67d4 100644 --- a/test/dot_s/function-data-sections.wast +++ b/test/dot_s/function-data-sections.wast @@ -4,6 +4,9 @@ (data (i32.const 12) "\00\00\00\00") (data (i32.const 16) "\01\00\00\00") (data (i32.const 20) "33\13@") + (export "stackSave" (func $stackSave)) + (export "stackAlloc" (func $stackAlloc)) + (export "stackRestore" (func $stackRestore)) (export "foo" (func $foo)) (export "bar" (func $bar)) (export "qux" (func $qux)) @@ -23,5 +26,38 @@ ) ) ) + (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": 24, "initializers": [] } |