1; RUN: llc -filetype=obj %s -o %t.o 2 3target triple = "wasm32-unknown-unknown" 4 5define hidden void @entry() local_unnamed_addr #0 { 6entry: 7 ret void 8} 9 10; RUN: wasm-ld -e entry -o %t1.wasm %t.o 11; RUN: obj2yaml %t1.wasm | FileCheck %s 12; RUN: wasm-ld --entry=entry -o %t2.wasm %t.o 13; RUN: obj2yaml %t2.wasm | FileCheck %s 14 15; CHECK: - Type: EXPORT 16; CHECK-NEXT: Exports: 17; CHECK-NEXT: - Name: memory 18; CHECK-NEXT: Kind: MEMORY 19; CHECK-NEXT: Index: 0 20; CHECK-NEXT: - Name: entry 21; CHECK-NEXT: Kind: FUNCTION 22; CHECK-NEXT: Index: 0 23; CHECK-NEXT: - Type: 24 25; The __wasm_call_ctors is somewhat special since its created by the linker. 26; Make sure we can use it as the entry point if we choose 27; RUN: wasm-ld --entry=__wasm_call_ctors -o %t3.wasm %t.o 28; RUN: obj2yaml %t3.wasm | FileCheck %s -check-prefix=CHECK-CTOR 29 30; CHECK-CTOR: - Type: EXPORT 31; CHECK-CTOR-NEXT: Exports: 32; CHECK-CTOR-NEXT: - Name: memory 33; CHECK-CTOR-NEXT: Kind: MEMORY 34; CHECK-CTOR-NEXT: Index: 0 35; CHECK-CTOR-NEXT: - Name: __wasm_call_ctors 36; CHECK-CTOR-NEXT: Kind: FUNCTION 37; CHECK-CTOR-NEXT: Index: 0 38; CHECK-CTOR-NEXT: - Type: 39