summaryrefslogtreecommitdiff
path: root/test/dot_s/initializers.s
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2016-04-06 09:05:09 -0700
committerDerek Schuff <dschuff@chromium.org>2016-04-06 09:05:09 -0700
commitc885ca69d19e7bd2c58b44eef242de334ac8c9dd (patch)
treeb308715bc24b4786bef3e18702332cc96751f0b2 /test/dot_s/initializers.s
parent176cac16a7a7910620f88d62b6a5675cdca87741 (diff)
downloadbinaryen-c885ca69d19e7bd2c58b44eef242de334ac8c9dd.tar.gz
binaryen-c885ca69d19e7bd2c58b44eef242de334ac8c9dd.tar.bz2
binaryen-c885ca69d19e7bd2c58b44eef242de334ac8c9dd.zip
Handle static initializers
LLVM emits static initializers in the ELF style, by placing pointers to the constructor functions in a .init_array section. Handle this in s2wasm for now by converting these to standard emscripten metadata.
Diffstat (limited to 'test/dot_s/initializers.s')
-rw-r--r--test/dot_s/initializers.s23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/dot_s/initializers.s b/test/dot_s/initializers.s
new file mode 100644
index 000000000..ed4ad1cff
--- /dev/null
+++ b/test/dot_s/initializers.s
@@ -0,0 +1,23 @@
+ .text
+ .file "/tmp/tmpAEEklZ/a.out.bc"
+ .globl main
+ .type main,@function
+main: # @main
+ .result i32
+# BB#0:
+ i32.const $push0=, 5
+ return $pop0
+.Lfunc_end0:
+ .size main, .Lfunc_end0-main
+ .globl f2
+ .type f2,@function
+f2:
+ return
+.Lfunc_end1:
+ .size f2, .Lfunc_end1-f2
+ .section .init_array.101,"aw",@init_array
+ .p2align 2
+ .int32 main@FUNCTION
+ .section .init_array,"aw",@init_array
+ .p2align 2
+ .int32 f2@FUNCTION