diff options
author | Alon Zakai <azakai@google.com> | 2019-09-30 17:15:20 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-30 17:15:20 -0700 |
commit | fc6d2df4eedfef53a0a29fed1ff3ce4707556700 (patch) | |
tree | fbfd641af0918ab06f5c0c9b7cf29b33ebc519e1 /test | |
parent | 3c27bc8267a52661ecfc2e1a369585ef420a6055 (diff) | |
download | binaryen-fc6d2df4eedfef53a0a29fed1ff3ce4707556700.tar.gz binaryen-fc6d2df4eedfef53a0a29fed1ff3ce4707556700.tar.bz2 binaryen-fc6d2df4eedfef53a0a29fed1ff3ce4707556700.zip |
Apply the sbrk/brk value at compile time (#2366)
We've had an option to set the location of the sbrk ptr, but not the value.
Applying the value as well is necessary for standalone wasm, as otherwise we set
it in JS.
Diffstat (limited to 'test')
2 files changed, 95 insertions, 0 deletions
diff --git a/test/passes/post-emscripten_pass-arg=emscripten-sbrk-ptr@16_pass-arg=emscripten-sbrk-val@42.txt b/test/passes/post-emscripten_pass-arg=emscripten-sbrk-ptr@16_pass-arg=emscripten-sbrk-val@42.txt new file mode 100644 index 000000000..119366efd --- /dev/null +++ b/test/passes/post-emscripten_pass-arg=emscripten-sbrk-ptr@16_pass-arg=emscripten-sbrk-val@42.txt @@ -0,0 +1,60 @@ +(module + (type $FUNCSIG$i (func (result i32))) + (memory $0 1 1) + (data (i32.const 0) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00*\00\00\00") + (func $internal (; 0 ;) (type $FUNCSIG$i) (result i32) + (i32.const 16) + ) +) +(module + (memory $0 1 1) + (data (i32.const 0) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00*\00\00\00") +) +(module + (type $FUNCSIG$i (func (result i32))) + (memory $0 10 10) + (data (i32.const 0) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00*\00\00\00") + (func $internal (; 0 ;) (type $FUNCSIG$i) (result i32) + (i32.const 16) + ) +) +(module + (type $FUNCSIG$i (func (result i32))) + (memory $0 10 10) + (data (i32.const 0) "1234567890123456*\00\00\00") + (func $internal (; 0 ;) (type $FUNCSIG$i) (result i32) + (i32.const 16) + ) +) +(module + (type $FUNCSIG$i (func (result i32))) + (memory $0 10 10) + (data (i32.const 0) "1234567890\00\00\00\00\00\00*\00\00\00") + (func $internal (; 0 ;) (type $FUNCSIG$i) (result i32) + (i32.const 16) + ) +) +(module + (type $FUNCSIG$i (func (result i32))) + (memory $0 10 10) + (data (i32.const 0) "\00\00\00\00\00\00\00\00\00\00123456*\00\00\001234567890") + (func $internal (; 0 ;) (type $FUNCSIG$i) (result i32) + (i32.const 16) + ) +) +(module + (type $FUNCSIG$i (func (result i32))) + (memory $0 10 10) + (data (i32.const 0) "\00\00\00\00\00\00\00\00\00\00123456*\00\00\00") + (func $internal (; 0 ;) (type $FUNCSIG$i) (result i32) + (i32.const 16) + ) +) +(module + (type $FUNCSIG$i (func (result i32))) + (memory $0 10 10) + (data (i32.const 0) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00*\00\00\00\00\00\00\001234567890") + (func $internal (; 0 ;) (type $FUNCSIG$i) (result i32) + (i32.const 16) + ) +) diff --git a/test/passes/post-emscripten_pass-arg=emscripten-sbrk-ptr@16_pass-arg=emscripten-sbrk-val@42.wast b/test/passes/post-emscripten_pass-arg=emscripten-sbrk-ptr@16_pass-arg=emscripten-sbrk-val@42.wast new file mode 100644 index 000000000..377afbc84 --- /dev/null +++ b/test/passes/post-emscripten_pass-arg=emscripten-sbrk-ptr@16_pass-arg=emscripten-sbrk-val@42.wast @@ -0,0 +1,35 @@ +(module + (import "env" "emscripten_get_sbrk_ptr" (func $internal(result i32))) +) +(module +) +(module + (memory $0 10 10) + (import "env" "emscripten_get_sbrk_ptr" (func $internal(result i32))) +) +(module + (memory $0 10 10) + (data (i32.const 0) "12345678901234567890") + (import "env" "emscripten_get_sbrk_ptr" (func $internal(result i32))) +) +(module + (memory $0 10 10) + (data (i32.const 0) "1234567890") + (import "env" "emscripten_get_sbrk_ptr" (func $internal(result i32))) +) +(module + (memory $0 10 10) + (data (i32.const 10) "12345678901234567890") + (import "env" "emscripten_get_sbrk_ptr" (func $internal(result i32))) +) +(module + (memory $0 10 10) + (data (i32.const 10) "1234567890") + (import "env" "emscripten_get_sbrk_ptr" (func $internal(result i32))) +) +(module + (memory $0 10 10) + (data (i32.const 24) "1234567890") + (import "env" "emscripten_get_sbrk_ptr" (func $internal(result i32))) +) + |