2018-01-24 11:29:47 +08:00
|
|
|
; RUN: llc -filetype=obj %s -o %t.o
|
2018-05-05 09:23:07 +08:00
|
|
|
; RUN: not wasm-ld --export=missing -o %t.wasm %t.o 2>&1 | FileCheck -check-prefix=CHECK-ERROR %s
|
|
|
|
; RUN: wasm-ld --export=hidden_function -o %t.wasm %t.o
|
2018-01-13 06:10:35 +08:00
|
|
|
; RUN: obj2yaml %t.wasm | FileCheck %s
|
|
|
|
|
2018-05-11 01:59:41 +08:00
|
|
|
target triple = "wasm32-unknown-unknown"
|
2018-01-24 11:29:47 +08:00
|
|
|
|
2018-01-13 06:10:35 +08:00
|
|
|
define hidden i32 @hidden_function() local_unnamed_addr {
|
|
|
|
entry:
|
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
2018-02-02 08:30:03 +08:00
|
|
|
define void @_start() local_unnamed_addr {
|
2018-01-13 06:10:35 +08:00
|
|
|
entry:
|
2018-02-02 08:30:03 +08:00
|
|
|
ret void
|
2018-01-13 06:10:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-ERROR: error: symbol exported via --export not found: missing
|
|
|
|
|
|
|
|
; CHECK: - Type: EXPORT
|
2018-01-24 08:22:53 +08:00
|
|
|
; CHECK-NEXT: Exports:
|
2018-01-13 06:10:35 +08:00
|
|
|
; CHECK-NEXT: - Name: memory
|
|
|
|
; CHECK-NEXT: Kind: MEMORY
|
|
|
|
; CHECK-NEXT: Index: 0
|
2018-01-17 09:34:31 +08:00
|
|
|
; CHECK-NEXT: - Name: __heap_base
|
|
|
|
; CHECK-NEXT: Kind: GLOBAL
|
|
|
|
; CHECK-NEXT: Index: 1
|
2018-02-07 11:04:53 +08:00
|
|
|
; CHECK-NEXT: - Name: __data_end
|
|
|
|
; CHECK-NEXT: Kind: GLOBAL
|
|
|
|
; CHECK-NEXT: Index: 2
|
2018-03-01 17:38:02 +08:00
|
|
|
; CHECK-NEXT: - Name: hidden_function
|
|
|
|
; CHECK-NEXT: Kind: FUNCTION
|
2018-03-12 23:44:07 +08:00
|
|
|
; CHECK-NEXT: Index: 1
|
2018-08-04 08:04:06 +08:00
|
|
|
; CHECK-NEXT: - Name: _start
|
|
|
|
; CHECK-NEXT: Kind: FUNCTION
|
|
|
|
; CHECK-NEXT: Index: 2
|
2018-01-13 06:10:35 +08:00
|
|
|
; CHECK-NEXT: - Type: CODE
|