diff options
author | Heejin Ahn <aheejin@users.noreply.github.com> | 2016-08-26 11:29:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-26 11:29:18 -0700 |
commit | 4a04fc609133313ab18ef49599f365d3587af55b (patch) | |
tree | ca259b046d5a6ec39c3c78370aad784024a87066 /test | |
parent | 801baed1ca81d87380d56298289fe8cc0b4f1e1a (diff) | |
download | binaryen-4a04fc609133313ab18ef49599f365d3587af55b.tar.gz binaryen-4a04fc609133313ab18ef49599f365d3587af55b.tar.bz2 binaryen-4a04fc609133313ab18ef49599f365d3587af55b.zip |
Asm.js-style setjmp/longjmp support for wasm (#681)
This needs to export realloc as well, in addition to malloc and free
handled in #4469. To support asm.js style setjmp/longjmp, wasm
needs to export realloc as well, in addition to malloc and free
handled in #4469. saveSetjmp() uses realloc within it, and realloc is
not implemented in JS glue code.
Diffstat (limited to 'test')
-rw-r--r-- | test/dot_s/export_malloc_free.s | 10 | ||||
-rw-r--r-- | test/dot_s/export_malloc_free.wast | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/test/dot_s/export_malloc_free.s b/test/dot_s/export_malloc_free.s index 0158811a4..2ace10db9 100644 --- a/test/dot_s/export_malloc_free.s +++ b/test/dot_s/export_malloc_free.s @@ -27,3 +27,13 @@ free: .endfunc .Lfunc_end21: .size free, .Lfunc_end21-free + + .weak realloc + .type realloc,@function +realloc: + .param i32, i32 + .result i32 + i32.const $push0=, 0 + .endfunc +.Lfunc_end22: + .size realloc, .Lfunc_end22-free diff --git a/test/dot_s/export_malloc_free.wast b/test/dot_s/export_malloc_free.wast index e3c2f3d6f..465049e16 100644 --- a/test/dot_s/export_malloc_free.wast +++ b/test/dot_s/export_malloc_free.wast @@ -4,6 +4,7 @@ (export "main" $main) (export "malloc" $malloc) (export "free" $free) + (export "realloc" $realloc) (func $main (result i32) (i32.const 0) ) @@ -12,5 +13,8 @@ ) (func $free (param $0 i32) ) + (func $realloc (param $0 i32) (param $1 i32) (result i32) + (i32.const 0) + ) ) ;; METADATA: { "asmConsts": {},"staticBump": 12, "initializers": [] } |