1 ; RUN: llc -filetype=obj -o %t.o %s
2 ; RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown %p/Inputs/hidden.s -o %t2.o
4 ; RUN: llvm-ar rcs %t2.a %t2.o
6 ; Test that symbols with hidden visibility are not export, even with
8 ; RUN: wasm-ld --export-dynamic %t.o %t2.a -o %t.wasm
9 ; RUN: obj2yaml %t.wasm | FileCheck %s
11 ; Test that symbols with default visibility are not exported without
13 ; RUN: wasm-ld %t.o %t2.a -o %t.nodef.wasm
14 ; RUN: obj2yaml %t.nodef.wasm | FileCheck %s -check-prefix=NO-DEFAULT
17 target triple = "wasm32-unknown-unknown"
19 define hidden i32 @objectHidden() {
24 define i32 @objectDefault() {
29 declare i32 @archiveHidden()
30 declare i32 @archiveDefault()
32 define void @_start() {
34 %call1 = call i32 @objectHidden()
35 %call2 = call i32 @objectDefault()
36 %call3 = call i32 @archiveHidden()
37 %call4 = call i32 @archiveDefault()
41 ; CHECK: - Type: EXPORT
42 ; CHECK-NEXT: Exports:
43 ; CHECK-NEXT: - Name: memory
44 ; CHECK-NEXT: Kind: MEMORY
45 ; CHECK-NEXT: Index: 0
46 ; CHECK-NEXT: - Name: objectDefault
47 ; CHECK-NEXT: Kind: FUNCTION
48 ; CHECK-NEXT: Index: 1
49 ; CHECK-NEXT: - Name: _start
50 ; CHECK-NEXT: Kind: FUNCTION
51 ; CHECK-NEXT: Index: 2
52 ; CHECK-NEXT: - Name: archiveDefault
53 ; CHECK-NEXT: Kind: FUNCTION
54 ; CHECK-NEXT: Index: 4
58 ; NO-DEFAULT: - Type: EXPORT
59 ; NO-DEFAULT-NEXT: Exports:
60 ; NO-DEFAULT-NEXT: - Name: memory
61 ; NO-DEFAULT-NEXT: Kind: MEMORY
62 ; NO-DEFAULT-NEXT: Index: 0
63 ; NO-DEFAULT-NEXT: - Name: _start
64 ; NO-DEFAULT-NEXT: Kind: FUNCTION
65 ; NO-DEFAULT-NEXT: Index: 2
66 ; NO-DEFAULT-NEXT: - Type: