2018-01-24 11:29:47 +08:00
|
|
|
; RUN: llc -filetype=obj %s -o %t.o
|
|
|
|
|
2018-05-11 01:59:41 +08:00
|
|
|
target triple = "wasm32-unknown-unknown"
|
2017-11-18 02:14:09 +08:00
|
|
|
|
2018-01-20 09:44:45 +08:00
|
|
|
define hidden void @entry() local_unnamed_addr #0 {
|
2017-11-18 02:14:09 +08:00
|
|
|
entry:
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-05-05 09:23:07 +08:00
|
|
|
; RUN: wasm-ld -e entry -o %t1.wasm %t.o
|
2018-01-20 09:44:45 +08:00
|
|
|
; RUN: obj2yaml %t1.wasm | FileCheck %s
|
2018-05-05 09:23:07 +08:00
|
|
|
; RUN: wasm-ld --entry=entry -o %t2.wasm %t.o
|
2018-01-20 09:44:45 +08:00
|
|
|
; RUN: obj2yaml %t2.wasm | FileCheck %s
|
|
|
|
|
|
|
|
; CHECK: - Type: EXPORT
|
|
|
|
; CHECK-NEXT: Exports:
|
|
|
|
; CHECK-NEXT: - Name: memory
|
|
|
|
; CHECK-NEXT: Kind: MEMORY
|
|
|
|
; CHECK-NEXT: Index: 0
|
|
|
|
; CHECK-NEXT: - Name: entry
|
|
|
|
; CHECK-NEXT: Kind: FUNCTION
|
2019-03-02 06:35:47 +08:00
|
|
|
; CHECK-NEXT: Index: 0
|
2018-03-01 17:38:02 +08:00
|
|
|
; CHECK-NEXT: - Type:
|
2018-01-20 09:44:45 +08:00
|
|
|
|
2018-05-15 07:01:16 +08:00
|
|
|
; The __wasm_call_ctors is somewhat special since its created by the linker.
|
|
|
|
; Make sure we can use it as the entry point if we choose
|
2018-05-05 09:23:07 +08:00
|
|
|
; RUN: wasm-ld --entry=__wasm_call_ctors -o %t3.wasm %t.o
|
2018-01-20 09:44:45 +08:00
|
|
|
; RUN: obj2yaml %t3.wasm | FileCheck %s -check-prefix=CHECK-CTOR
|
|
|
|
|
|
|
|
; CHECK-CTOR: - Type: EXPORT
|
|
|
|
; CHECK-CTOR-NEXT: Exports:
|
|
|
|
; CHECK-CTOR-NEXT: - Name: memory
|
|
|
|
; CHECK-CTOR-NEXT: Kind: MEMORY
|
|
|
|
; CHECK-CTOR-NEXT: Index: 0
|
|
|
|
; CHECK-CTOR-NEXT: - Name: __wasm_call_ctors
|
|
|
|
; CHECK-CTOR-NEXT: Kind: FUNCTION
|
2018-01-31 09:45:47 +08:00
|
|
|
; CHECK-CTOR-NEXT: Index: 0
|
2018-03-01 17:38:02 +08:00
|
|
|
; CHECK-CTOR-NEXT: - Type:
|