diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-01-06 16:15:10 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-01-06 16:15:10 -0800 |
commit | 176a955c63f7891f00c1f29e33079dc3d77539da (patch) | |
tree | e539c910c8eadfc664a26caa464b53d31d86a264 | |
parent | 9053bd501b9e69c044410900fdeac25bd38b078e (diff) | |
parent | 3cfb90c2acac907dfbf9db7ad0940a06183dcda4 (diff) | |
download | binaryen-176a955c63f7891f00c1f29e33079dc3d77539da.tar.gz binaryen-176a955c63f7891f00c1f29e33079dc3d77539da.tar.bz2 binaryen-176a955c63f7891f00c1f29e33079dc3d77539da.zip |
Merge branch 'sections-visibilties'
-rw-r--r-- | src/s2wasm.h | 2 | ||||
-rw-r--r-- | test/dot_s/function-data-sections.s | 53 | ||||
-rw-r--r-- | test/dot_s/function-data-sections.wast | 35 | ||||
-rw-r--r-- | test/dot_s/visibilities.s | 24 | ||||
-rw-r--r-- | test/dot_s/visibilities.wast | 28 |
5 files changed, 141 insertions, 1 deletions
diff --git a/src/s2wasm.h b/src/s2wasm.h index d51c90e5e..48d6d9350 100644 --- a/src/s2wasm.h +++ b/src/s2wasm.h @@ -311,7 +311,7 @@ private: s++; if (match("text")) parseText(); else if (match("type")) parseType(); - else if (match("weak")) getStr(); // contents are in the type that follows + else if (match("weak") || match("hidden") || match("protected") || match("internal")) getStr(); // contents are in the content that follows else if (match("imports")) skipImports(); else if (match("data")) {} else if (match("ident")) {} diff --git a/test/dot_s/function-data-sections.s b/test/dot_s/function-data-sections.s new file mode 100644 index 000000000..68942b1af --- /dev/null +++ b/test/dot_s/function-data-sections.s @@ -0,0 +1,53 @@ + .text + .section .text.foo,"ax",@progbits + .globl foo + .type foo,@function +foo: + return +func_end0: + .size foo, func_end0-foo + + .section .text.bar,"ax",@progbits + .globl bar + .type bar,@function +bar: + .param i32 + .result i32 + return $0 +func_end1: + .size bar, func_end1-bar + + .section .text.qux,"ax",@progbits + .globl qux + .type qux,@function +qux: + .param f64, f64 + .result f64 + f64.add $push0=, $0, $1 + return $pop0 +func_end2: + .size qux, func_end2-qux + + .type aaa,@object + .section .bss.aaa,"aw",@nobits + .globl aaa + .align 2 +aaa: + .int32 0 + .size aaa, 4 + + .type bbb,@object + .section .data.bbb,"aw",@progbits + .globl bbb + .align 2 +bbb: + .int32 1 + .size bbb, 4 + + .type ccc,@object + .section .data.ccc,"aw",@progbits + .globl ccc + .align 2 +ccc: + .int32 1075000115 + .size ccc, 4 diff --git a/test/dot_s/function-data-sections.wast b/test/dot_s/function-data-sections.wast new file mode 100644 index 000000000..3620f33c6 --- /dev/null +++ b/test/dot_s/function-data-sections.wast @@ -0,0 +1,35 @@ +(module + (memory 16 4294967295 (segment 4 "\00\00\00\00") (segment 8 "\01\00\00\00") (segment 12 "33\13@")) + (export "foo" $foo) + (export "bar" $bar) + (export "qux" $qux) + (func $foo + (block $fake_return_waka123 + (block + (br $fake_return_waka123) + ) + ) + ) + (func $bar (param $$0 i32) (result i32) + (block $fake_return_waka123 + (block + (br $fake_return_waka123 + (get_local $$0) + ) + ) + ) + ) + (func $qux (param $$0 f64) (param $$1 f64) (result f64) + (block $fake_return_waka123 + (block + (br $fake_return_waka123 + (f64.add + (get_local $$0) + (get_local $$1) + ) + ) + ) + ) + ) +) +;; METADATA: { "asmConsts": {},"staticBump": 15 } diff --git a/test/dot_s/visibilities.s b/test/dot_s/visibilities.s new file mode 100644 index 000000000..288073be0 --- /dev/null +++ b/test/dot_s/visibilities.s @@ -0,0 +1,24 @@ + .text + .hidden foo + .globl foo + .type foo,@function +foo: + return +func_end0: + .size foo, func_end0-foo + + .protected bar + .globl bar + .type bar,@function +bar: + return +func_end1: + .size bar, func_end1-bar + + .internal qux + .globl qux + .type qux,@function +qux: + return +func_end2: + .size qux, func_end2-qux diff --git a/test/dot_s/visibilities.wast b/test/dot_s/visibilities.wast new file mode 100644 index 000000000..261834b58 --- /dev/null +++ b/test/dot_s/visibilities.wast @@ -0,0 +1,28 @@ +(module + (memory 0 4294967295) + (export "foo" $foo) + (export "bar" $bar) + (export "qux" $qux) + (func $foo + (block $fake_return_waka123 + (block + (br $fake_return_waka123) + ) + ) + ) + (func $bar + (block $fake_return_waka123 + (block + (br $fake_return_waka123) + ) + ) + ) + (func $qux + (block $fake_return_waka123 + (block + (br $fake_return_waka123) + ) + ) + ) +) +;; METADATA: { "asmConsts": {},"staticBump": 0 } |