Index: lld/trunk/test/wasm/Inputs/call-indirect.ll =================================================================== --- lld/trunk/test/wasm/Inputs/call-indirect.ll +++ lld/trunk/test/wasm/Inputs/call-indirect.ll @@ -1,18 +1,17 @@ -target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" -target triple = "wasm32-unknown-unknown-wasm" +@indirect_bar = internal local_unnamed_addr global i32 ()* @bar, align 4 +@indirect_foo = internal local_unnamed_addr global i32 ()* @foo, align 4 -@indirect_bar = hidden local_unnamed_addr global i32 ()* @bar, align 4 +declare i32 @foo() local_unnamed_addr -; Function Attrs: norecurse nounwind readnone -define i32 @bar() #0 { +define i32 @bar() { entry: ret i32 1 } -; Function Attrs: nounwind define void @call_bar_indirect() local_unnamed_addr #1 { entry: %0 = load i32 ()*, i32 ()** @indirect_bar, align 4 + %1 = load i32 ()*, i32 ()** @indirect_foo, align 4 %call = tail call i32 %0() #2 ret void } Index: lld/trunk/test/wasm/Inputs/hello.ll =================================================================== --- lld/trunk/test/wasm/Inputs/hello.ll +++ lld/trunk/test/wasm/Inputs/hello.ll @@ -2,9 +2,6 @@ ; void puts(const char*); ; void hello() { puts("hello\n"); } -target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" -target triple = "wasm32-unknown-unknown-wasm" - @hello_str = unnamed_addr constant [7 x i8] c"hello\0A\00", align 1 ; Function Attrs: nounwind Index: lld/trunk/test/wasm/Inputs/hidden.ll =================================================================== --- lld/trunk/test/wasm/Inputs/hidden.ll +++ lld/trunk/test/wasm/Inputs/hidden.ll @@ -1,6 +1,3 @@ -target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" -target triple = "wasm32-unknown-unknown-wasm" - ; Function Attrs: norecurse nounwind readnone define hidden i32 @archiveHidden() #0 { entry: Index: lld/trunk/test/wasm/Inputs/many-funcs.ll =================================================================== --- lld/trunk/test/wasm/Inputs/many-funcs.ll +++ lld/trunk/test/wasm/Inputs/many-funcs.ll @@ -1,6 +1,3 @@ -target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" -target triple = "wasm32-unknown-unknown-wasm" - @g0 = global i32 1, align 4 @foo = global i32 1, align 4 Index: lld/trunk/test/wasm/Inputs/ret32.ll =================================================================== --- lld/trunk/test/wasm/Inputs/ret32.ll +++ lld/trunk/test/wasm/Inputs/ret32.ll @@ -1,6 +1,3 @@ -target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" -target triple = "wasm32-unknown-unknown-wasm" - ; Function Attrs: norecurse nounwind readnone define i32 @ret32(float %arg) #0 { entry: Index: lld/trunk/test/wasm/Inputs/ret64.ll =================================================================== --- lld/trunk/test/wasm/Inputs/ret64.ll +++ lld/trunk/test/wasm/Inputs/ret64.ll @@ -1,6 +1,3 @@ -target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" -target triple = "wasm32-unknown-unknown-wasm" - define i64 @ret64(double %arg) local_unnamed_addr #0 { entry: ret i64 1 Index: lld/trunk/test/wasm/Inputs/weak-alias.ll =================================================================== --- lld/trunk/test/wasm/Inputs/weak-alias.ll +++ lld/trunk/test/wasm/Inputs/weak-alias.ll @@ -1,3 +1,4 @@ +; Function Attrs: norecurse nounwind readnone define i32 @foo() #0 { entry: ret i32 0 Index: lld/trunk/test/wasm/Inputs/weak-symbol1.ll =================================================================== --- lld/trunk/test/wasm/Inputs/weak-symbol1.ll +++ lld/trunk/test/wasm/Inputs/weak-symbol1.ll @@ -0,0 +1,9 @@ +define weak i32 @weakFn() #0 { +entry: + ret i32 1 +} + +define i32 @exportWeak1() { +entry: + ret i32 ptrtoint (i32 ()* @weakFn to i32) +} Index: lld/trunk/test/wasm/Inputs/weak-symbol2.ll =================================================================== --- lld/trunk/test/wasm/Inputs/weak-symbol2.ll +++ lld/trunk/test/wasm/Inputs/weak-symbol2.ll @@ -0,0 +1,9 @@ +define weak i32 @weakFn() #0 { +entry: + ret i32 2 +} + +define i32 @exportWeak2() { +entry: + ret i32 ptrtoint (i32 ()* @weakFn to i32) +} Index: lld/trunk/test/wasm/call-indirect.ll =================================================================== --- lld/trunk/test/wasm/call-indirect.ll +++ lld/trunk/test/wasm/call-indirect.ll @@ -1,5 +1,5 @@ -; RUN: llc -filetype=obj %p/Inputs/call-indirect.ll -o %t2.o -; RUN: llc -filetype=obj %s -o %t.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/call-indirect.ll -o %t2.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %s -o %t.o ; RUN: lld -flavor wasm -o %t.wasm %t2.o %t.o ; RUN: obj2yaml %t.wasm | FileCheck %s @@ -8,9 +8,6 @@ ; int (*indirect_func)(void) = &foo; ; void _start(void) { indirect_func(); } -target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" -target triple = "wasm32-unknown-unknown-wasm" - @indirect_func = local_unnamed_addr global i32 ()* @foo, align 4 ; Function Attrs: norecurse nounwind readnone @@ -46,8 +43,8 @@ ; CHECK-NEXT: - ElemType: ANYFUNC ; CHECK-NEXT: Limits: ; CHECK-NEXT: Flags: 0x00000001 -; CHECK-NEXT: Initial: 0x00000003 -; CHECK-NEXT: Maximum: 0x00000003 +; CHECK-NEXT: Initial: 0x00000004 +; CHECK-NEXT: Maximum: 0x00000004 ; CHECK-NEXT: - Type: MEMORY ; CHECK-NEXT: Memories: ; CHECK-NEXT: - Initial: 0x00000002 @@ -66,21 +63,21 @@ ; CHECK-NEXT: - Name: _start ; CHECK-NEXT: Kind: FUNCTION ; CHECK-NEXT: Index: 3 +; CHECK-NEXT: - Name: foo +; CHECK-NEXT: Kind: FUNCTION +; CHECK-NEXT: Index: 2 ; CHECK-NEXT: - Name: bar ; CHECK-NEXT: Kind: FUNCTION ; CHECK-NEXT: Index: 0 ; CHECK-NEXT: - Name: call_bar_indirect ; CHECK-NEXT: Kind: FUNCTION ; CHECK-NEXT: Index: 1 -; CHECK-NEXT: - Name: foo -; CHECK-NEXT: Kind: FUNCTION -; CHECK-NEXT: Index: 2 ; CHECK: - Type: ELEM ; CHECK-NEXT: Segments: ; CHECK-NEXT: - Offset: ; CHECK-NEXT: Opcode: I32_CONST ; CHECK-NEXT: Value: 1 -; CHECK-NEXT: Functions: [ 0, 2 ] +; CHECK-NEXT: Functions: [ 0, 2, 2 ] ; CHECK-NEXT: - Type: CODE ; CHECK-NEXT: Functions: ; CHECK: - Locals: @@ -93,10 +90,10 @@ ; CHECK-NEXT: Offset: ; CHECK-NEXT: Opcode: I32_CONST ; CHECK-NEXT: Value: 1024 -; CHECK-NEXT: Content: '0100000002000000' +; CHECK-NEXT: Content: '010000000200000003000000' ; CHECK-NEXT: - Type: CUSTOM ; CHECK-NEXT: Name: linking -; CHECK-NEXT: DataSize: 8 +; CHECK-NEXT: DataSize: 12 ; CHECK-NEXT: - Type: CUSTOM ; CHECK-NEXT: Name: name ; CHECK-NEXT: FunctionNames: Index: lld/trunk/test/wasm/conflict.test =================================================================== --- lld/trunk/test/wasm/conflict.test +++ lld/trunk/test/wasm/conflict.test @@ -1,4 +1,4 @@ -# RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o +# RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/ret32.ll -o %t.ret32.o # RUN: not lld -flavor wasm -o %t.wasm %t.ret32.o %t.ret32.o 2>&1 | FileCheck %s # CHECK: duplicate symbol: ret32 Index: lld/trunk/test/wasm/data-layout.ll =================================================================== --- lld/trunk/test/wasm/data-layout.ll +++ lld/trunk/test/wasm/data-layout.ll @@ -1,11 +1,8 @@ -; RUN: llc -filetype=obj %p/Inputs/hello.ll -o %t.hello.o -; RUN: llc -filetype=obj %s -o %t.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/hello.ll -o %t.hello.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %s -o %t.o ; RUN: lld -flavor wasm --emit-relocs --allow-undefined --no-entry -o %t.wasm %t.o %t.hello.o ; RUN: obj2yaml %t.wasm | FileCheck %s -target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" -target triple = "wasm32-unknown-unknown-wasm" - @foo = hidden global i32 1, align 4 @aligned_bar = hidden global i32 3, align 16 Index: lld/trunk/test/wasm/entry.ll =================================================================== --- lld/trunk/test/wasm/entry.ll +++ lld/trunk/test/wasm/entry.ll @@ -1,12 +1,9 @@ -; RUN: llc -filetype=obj %s -o %t.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %s -o %t.o ; RUN: lld -flavor wasm -e entry -o %t.wasm %t.o ; RUN: obj2yaml %t.wasm | FileCheck %s ; RUN: lld -flavor wasm --entry=entry -o %t.wasm %t.o ; RUN: obj2yaml %t.wasm | FileCheck %s -target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" -target triple = "wasm32-unknown-unknown-wasm" - define void @entry() local_unnamed_addr #0 { entry: ret void Index: lld/trunk/test/wasm/function-imports-first.ll =================================================================== --- lld/trunk/test/wasm/function-imports-first.ll +++ lld/trunk/test/wasm/function-imports-first.ll @@ -1,11 +1,8 @@ -; RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o -; RUN: llc -filetype=obj %s -o %t.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/ret32.ll -o %t.ret32.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %s -o %t.o ; RUN: lld -flavor wasm -o %t.wasm %t.o %t.ret32.o ; RUN: obj2yaml %t.wasm | FileCheck %s -target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" -target triple = "wasm32-unknown-unknown-wasm" - ; Function Attrs: nounwind define hidden void @_start() local_unnamed_addr #0 { entry: Index: lld/trunk/test/wasm/function-imports.ll =================================================================== --- lld/trunk/test/wasm/function-imports.ll +++ lld/trunk/test/wasm/function-imports.ll @@ -1,11 +1,8 @@ -; RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o -; RUN: llc -filetype=obj %s -o %t.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/ret32.ll -o %t.ret32.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %s -o %t.o ; RUN: lld -flavor wasm -o %t.wasm %t.ret32.o %t.o ; RUN: obj2yaml %t.wasm | FileCheck %s -target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" -target triple = "wasm32-unknown-unknown-wasm" - ; Function Attrs: nounwind define hidden void @_start() local_unnamed_addr #0 { entry: Index: lld/trunk/test/wasm/function-index.test =================================================================== --- lld/trunk/test/wasm/function-index.test +++ lld/trunk/test/wasm/function-index.test @@ -1,5 +1,5 @@ -# RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o -# RUN: llc -filetype=obj %p/Inputs/ret64.ll -o %t.ret64.o +# RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/ret32.ll -o %t.ret32.o +# RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/ret64.ll -o %t.ret64.o # RUN: lld -flavor wasm -r -o %t.wasm %t.ret32.o %t.ret64.o # RUN: obj2yaml %t.wasm | FileCheck %s Index: lld/trunk/test/wasm/import-memory.test =================================================================== --- lld/trunk/test/wasm/import-memory.test +++ lld/trunk/test/wasm/import-memory.test @@ -1,4 +1,4 @@ -# RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o +# RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/ret32.ll -o %t.ret32.o # RUN: lld -flavor wasm -entry ret32 --import-memory -o %t.wasm %t.ret32.o # RUN: obj2yaml %t.wasm | FileCheck %s Index: lld/trunk/test/wasm/local-symbols.ll =================================================================== --- lld/trunk/test/wasm/local-symbols.ll +++ lld/trunk/test/wasm/local-symbols.ll @@ -1,10 +1,7 @@ -; RUN: llc -filetype=obj %s -o %t.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %s -o %t.o ; RUN: lld -flavor wasm -o %t.wasm %t.o ; RUN: obj2yaml %t.wasm | FileCheck %s -target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" -target triple = "wasm32-unknown-unknown-wasm" - @foo = default global i32 1, align 4 @bar = internal default global i32 3, align 4 Index: lld/trunk/test/wasm/many-functions.ll =================================================================== --- lld/trunk/test/wasm/many-functions.ll +++ lld/trunk/test/wasm/many-functions.ll @@ -1,5 +1,5 @@ -; RUN: llc -filetype=obj %p/Inputs/many-funcs.ll -o %t.many.o -; RUN: llc -filetype=obj %s -o %t.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/many-funcs.ll -o %t.many.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %s -o %t.o ; RUN: lld -flavor wasm -r -o %t.wasm %t.many.o %t.o ; RUN: obj2yaml %t.wasm | FileCheck %s @@ -8,9 +8,6 @@ ; 128 function and so the final output requires a 2-byte LEB in ; the CODE section header to store the function count. -target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" -target triple = "wasm32-unknown-unknown-wasm" - define i32 @func() { entry: %call = tail call i32 @func() Index: lld/trunk/test/wasm/relocatable.ll =================================================================== --- lld/trunk/test/wasm/relocatable.ll +++ lld/trunk/test/wasm/relocatable.ll @@ -1,11 +1,8 @@ -; RUN: llc -filetype=obj %p/Inputs/hello.ll -o %t.hello.o -; RUN: llc -filetype=obj %s -o %t.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/hello.ll -o %t.hello.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %s -o %t.o ; RUN: lld -flavor wasm -r -o %t.wasm %t.hello.o %t.o ; RUN: obj2yaml %t.wasm | FileCheck %s -target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" -target triple = "wasm32-unknown-unknown-wasm" - ; Function Attrs: nounwind define hidden i32 @my_func() local_unnamed_addr { entry: Index: lld/trunk/test/wasm/signature-mismatch.ll =================================================================== --- lld/trunk/test/wasm/signature-mismatch.ll +++ lld/trunk/test/wasm/signature-mismatch.ll @@ -1,10 +1,7 @@ -; RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o -; RUN: llc -filetype=obj %s -o %t.main.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/ret32.ll -o %t.ret32.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %s -o %t.main.o ; RUN: not lld -flavor wasm --check-signatures -o %t.wasm %t.main.o %t.ret32.o 2>&1 | FileCheck %s -target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" -target triple = "wasm32-unknown-unknown-wasm" - ; Function Attrs: nounwind define hidden void @_start() local_unnamed_addr #0 { entry: Index: lld/trunk/test/wasm/stack-pointer.ll =================================================================== --- lld/trunk/test/wasm/stack-pointer.ll +++ lld/trunk/test/wasm/stack-pointer.ll @@ -1,10 +1,7 @@ -; RUN: llc -filetype=obj %s -o %t.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %s -o %t.o ; RUN: lld -flavor wasm --emit-relocs -o %t.wasm %t.o ; RUN: obj2yaml %t.wasm | FileCheck %s -target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" -target triple = "wasm32-unknown-unknown-wasm" - ; Function Attrs: nounwind define hidden i32 @_start() local_unnamed_addr { entry: Index: lld/trunk/test/wasm/strip-debug.test =================================================================== --- lld/trunk/test/wasm/strip-debug.test +++ lld/trunk/test/wasm/strip-debug.test @@ -1,4 +1,4 @@ -RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o +RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/ret32.ll -o %t.ret32.o RUN: lld -flavor wasm --strip-debug --entry=ret32 -o %t.wasm %t.ret32.o RUN: obj2yaml %t.wasm | FileCheck %s Index: lld/trunk/test/wasm/symbol-type-mismatch.ll =================================================================== --- lld/trunk/test/wasm/symbol-type-mismatch.ll +++ lld/trunk/test/wasm/symbol-type-mismatch.ll @@ -1,10 +1,7 @@ -; RUN: llc -filetype=obj %s -o %t.o -; RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %s -o %t.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/ret32.ll -o %t.ret32.o ; RUN: not lld -flavor wasm -o %t.wasm %t.o %t.ret32.o 2>&1 | FileCheck %s -target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" -target triple = "wasm32-unknown-unknown-wasm" - @ret32 = extern_weak global i32, align 4 ; CHECK: error: symbol type mismatch: ret32 Index: lld/trunk/test/wasm/undefined-entry.test =================================================================== --- lld/trunk/test/wasm/undefined-entry.test +++ lld/trunk/test/wasm/undefined-entry.test @@ -1,4 +1,4 @@ -RUN: llc -filetype=obj %p/Inputs/ret32.ll -o %t.ret32.o +RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/ret32.ll -o %t.ret32.o RUN: not lld -flavor wasm -o %t.wasm %t.ret32.o 2>&1 | FileCheck %s CHECK: error: undefined symbol: _start Index: lld/trunk/test/wasm/undefined.ll =================================================================== --- lld/trunk/test/wasm/undefined.ll +++ lld/trunk/test/wasm/undefined.ll @@ -1,4 +1,4 @@ -; RUN: llc -filetype=obj %s -o %t.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %s -o %t.o ; RUN: lld -flavor wasm --allow-undefined -o %t.wasm %t.o ; Fails due to undefined 'foo' @@ -9,9 +9,6 @@ ; RUN: echo 'foo' > %t.txt ; RUN: lld -flavor wasm --allow-undefined-file=%t.txt -o %t.wasm %t.o -target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" -target triple = "wasm32-unknown-unknown-wasm" - ; Takes the address of the external foo() resulting in undefined external @bar = hidden local_unnamed_addr global i8* bitcast (i32 ()* @foo to i8*), align 4 Index: lld/trunk/test/wasm/version.ll =================================================================== --- lld/trunk/test/wasm/version.ll +++ lld/trunk/test/wasm/version.ll @@ -1,10 +1,7 @@ -; RUN: llc -filetype=obj %s -o %t.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %s -o %t.o ; RUN: lld -flavor wasm -o %t.wasm %t.o ; RUN: llvm-readobj -file-headers %t.wasm | FileCheck %s -target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" -target triple = "wasm32-unknown-unknown-wasm" - define hidden void @_start() local_unnamed_addr #0 { entry: ret void Index: lld/trunk/test/wasm/visibility-hidden.ll =================================================================== --- lld/trunk/test/wasm/visibility-hidden.ll +++ lld/trunk/test/wasm/visibility-hidden.ll @@ -1,4 +1,4 @@ -; RUN: llc -mtriple wasm32-unknown-unknown-wasm -filetype=obj -o %t.o %s +; RUN: llc -mtriple=wasm32-unknown-unknown-wasm -filetype=obj -o %t.o %s ; RUN: llc -mtriple=wasm32-unknown-unknown-wasm -filetype=obj %S/Inputs/hidden.ll -o %t2.o ; RUN: llvm-ar rcs %t2.a %t2.o ; RUN: lld -flavor wasm %t.o %t2.a -o %t.wasm Index: lld/trunk/test/wasm/weak-symbols.ll =================================================================== --- lld/trunk/test/wasm/weak-symbols.ll +++ lld/trunk/test/wasm/weak-symbols.ll @@ -0,0 +1,93 @@ +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/weak-symbol1.ll -o %t1.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %p/Inputs/weak-symbol2.ll -o %t2.o +; RUN: llc -filetype=obj -mtriple=wasm32-unknown-uknown-wasm %s -o %t.o +; RUN: lld -flavor wasm -o %t.wasm %t.o %t1.o %t2.o +; RUN: obj2yaml %t.wasm | FileCheck %s + +declare i32 @weakFn() local_unnamed_addr + +define void @_start() local_unnamed_addr { +entry: + %call = call i32 @weakFn() + ret void +} + +; CHECK: --- !WASM +; CHECK-NEXT: FileHeader: +; CHECK-NEXT: Version: 0x00000001 +; CHECK-NEXT: Sections: +; CHECK-NEXT: - Type: TYPE +; CHECK-NEXT: Signatures: +; CHECK-NEXT: - Index: 0 +; CHECK-NEXT: ReturnType: NORESULT +; CHECK-NEXT: ParamTypes: +; CHECK-NEXT: - Index: 1 +; CHECK-NEXT: ReturnType: I32 +; CHECK-NEXT: ParamTypes: +; CHECK-NEXT: - Type: FUNCTION +; CHECK-NEXT: FunctionTypes: [ 0, 1, 1, 1, 1 ] +; CHECK-NEXT: - Type: TABLE +; CHECK-NEXT: Tables: +; CHECK-NEXT: - ElemType: ANYFUNC +; CHECK-NEXT: Limits: +; CHECK-NEXT: Flags: 0x00000001 +; CHECK-NEXT: Initial: 0x00000003 +; CHECK-NEXT: Maximum: 0x00000003 +; CHECK-NEXT: - Type: MEMORY +; CHECK-NEXT: Memories: +; CHECK-NEXT: - Initial: 0x00000002 +; CHECK-NEXT: - Type: GLOBAL +; CHECK-NEXT: Globals: +; CHECK-NEXT: - Type: I32 +; CHECK-NEXT: Mutable: true +; CHECK-NEXT: InitExpr: +; CHECK-NEXT: Opcode: I32_CONST +; CHECK-NEXT: Value: 66560 +; CHECK-NEXT: - Type: EXPORT +; CHECK-NEXT: Exports: +; CHECK-NEXT: - Name: memory +; CHECK-NEXT: Kind: MEMORY +; CHECK-NEXT: Index: 0 +; CHECK-NEXT: - Name: _start +; CHECK-NEXT: Kind: FUNCTION +; CHECK-NEXT: Index: 0 +; CHECK-NEXT: - Name: weakFn +; CHECK-NEXT: Kind: FUNCTION +; CHECK-NEXT: Index: 1 +; CHECK-NEXT: - Name: exportWeak1 +; CHECK-NEXT: Kind: FUNCTION +; CHECK-NEXT: Index: 2 +; CHECK-NEXT: - Name: exportWeak2 +; CHECK-NEXT: Kind: FUNCTION +; CHECK-NEXT: Index: 4 +; CHECK-NEXT: - Type: ELEM +; CHECK-NEXT: Segments: +; CHECK-NEXT: - Offset: +; CHECK-NEXT: Opcode: I32_CONST +; CHECK-NEXT: Value: 1 +; CHECK-NEXT: Functions: [ 1, 1 ] +; CHECK-NEXT: - Type: CODE +; CHECK-NEXT: Functions: +; CHECK-NEXT: - Locals: +; CHECK-NEXT: Body: 1081808080001A0B +; CHECK-NEXT: - Locals: +; CHECK-NEXT: Body: 41010B +; CHECK-NEXT: - Locals: +; CHECK-NEXT: Body: 4181808080000B +; CHECK-NEXT: - Locals: +; CHECK-NEXT: Body: 41020B +; CHECK-NEXT: - Locals: +; CHECK-NEXT: Body: 4182808080000B +; CHECK-NEXT: - Type: CUSTOM +; CHECK-NEXT: Name: linking +; CHECK-NEXT: DataSize: 0 +; CHECK-NEXT: - Type: CUSTOM +; CHECK-NEXT: Name: name +; CHECK-NEXT: FunctionNames: +; CHECK-NEXT: - Index: 0 +; CHECK-NEXT: Name: _start +; CHECK-NEXT: - Index: 2 +; CHECK-NEXT: Name: exportWeak1 +; CHECK-NEXT: - Index: 4 +; CHECK-NEXT: Name: exportWeak2 +; CHECK-NEXT: ...