2018-01-24 11:29:47 +08:00
|
|
|
; RUN: llc -filetype=obj -o %t.o %s
|
|
|
|
; RUN: llc -filetype=obj %S/Inputs/hidden.ll -o %t2.o
|
2017-12-03 10:38:04 +08:00
|
|
|
; RUN: llvm-ar rcs %t2.a %t2.o
|
2018-05-05 09:23:07 +08:00
|
|
|
; RUN: wasm-ld %t.o %t2.a -o %t.wasm
|
2017-12-03 10:38:04 +08:00
|
|
|
; RUN: obj2yaml %t.wasm | FileCheck %s
|
|
|
|
|
|
|
|
; Test that hidden symbols are not exported, whether pulled in from an archive
|
|
|
|
; or directly.
|
|
|
|
|
2018-05-11 01:59:41 +08:00
|
|
|
target triple = "wasm32-unknown-unknown"
|
2018-01-24 11:29:47 +08:00
|
|
|
|
2017-12-03 10:38:04 +08:00
|
|
|
define hidden i32 @objectHidden() {
|
|
|
|
entry:
|
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @objectDefault() {
|
|
|
|
entry:
|
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i32 @archiveHidden()
|
|
|
|
declare i32 @archiveDefault()
|
|
|
|
|
2018-02-02 08:30:03 +08:00
|
|
|
define void @_start() {
|
2017-12-03 10:38:04 +08:00
|
|
|
entry:
|
|
|
|
%call1 = call i32 @objectHidden()
|
|
|
|
%call2 = call i32 @objectDefault()
|
|
|
|
%call3 = call i32 @archiveHidden()
|
|
|
|
%call4 = call i32 @archiveDefault()
|
2018-02-02 08:30:03 +08:00
|
|
|
ret void
|
2017-12-03 10:38:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK: - Type: EXPORT
|
2017-12-13 04:00:30 +08:00
|
|
|
; CHECK-NEXT: Exports:
|
2017-12-03 10:38:04 +08:00
|
|
|
; CHECK-NEXT: - Name: memory
|
|
|
|
; CHECK-NEXT: Kind: MEMORY
|
|
|
|
; CHECK-NEXT: Index: 0
|
2018-03-01 17:38:02 +08:00
|
|
|
; CHECK-NEXT: - Name: __heap_base
|
|
|
|
; CHECK-NEXT: Kind: GLOBAL
|
2017-12-03 10:38:04 +08:00
|
|
|
; CHECK-NEXT: Index: 1
|
2018-03-01 17:38:02 +08:00
|
|
|
; CHECK-NEXT: - Name: __data_end
|
|
|
|
; CHECK-NEXT: Kind: GLOBAL
|
|
|
|
; CHECK-NEXT: Index: 2
|
2018-01-20 09:44:45 +08:00
|
|
|
; CHECK-NEXT: - Name: _start
|
|
|
|
; CHECK-NEXT: Kind: FUNCTION
|
2018-03-12 23:44:07 +08:00
|
|
|
; CHECK-NEXT: Index: 3
|
2018-03-01 17:38:02 +08:00
|
|
|
; CHECK-NEXT: - Name: objectDefault
|
|
|
|
; CHECK-NEXT: Kind: FUNCTION
|
2018-03-12 23:44:07 +08:00
|
|
|
; CHECK-NEXT: Index: 2
|
2018-01-19 07:40:49 +08:00
|
|
|
; CHECK-NEXT: - Name: archiveDefault
|
|
|
|
; CHECK-NEXT: Kind: FUNCTION
|
2018-03-12 23:44:07 +08:00
|
|
|
; CHECK-NEXT: Index: 5
|
2017-12-03 10:38:04 +08:00
|
|
|
; CHECK-NEXT: - Type:
|