1; RUN: llc -O0 -filetype=obj %s -o %t.o
2
3; RUN: wasm-ld -o %t.wasm %t.o
4; RUN: obj2yaml %t.wasm | FileCheck %s
5
6; RUN: wasm-ld --export-all -o %t.wasm %t.o
7; RUN: obj2yaml %t.wasm | FileCheck %s -check-prefix=EXPORT
8
9; RUN: wasm-ld --export-all --no-gc-sections -o %t.wasm %t.o
10; RUN: obj2yaml %t.wasm | FileCheck %s -check-prefix=EXPORT
11
12; Verify the --export-all flag exports hidden symbols
13
14target triple = "wasm32-unknown-unknown"
15
16define internal void @internal_func() local_unnamed_addr {
17entry:
18  ret void
19}
20
21define hidden void @bar() local_unnamed_addr {
22entry:
23  ret void
24}
25
26define hidden void @foo() local_unnamed_addr {
27entry:
28  ret void
29}
30
31define hidden void @_start() local_unnamed_addr {
32entry:
33  call void @foo()
34  call void @internal_func()
35  ret void
36}
37
38; CHECK:      - Type:            EXPORT
39; CHECK:         - Name:            _start
40; CHECK-NOT:     - Name:            bar
41; CHECK-NOT:     - Name:            foo
42; CHECK-NOT:     - Name:            internal_func
43
44; EXPORT:     - Type:            EXPORT
45; EXPORT:        - Name:            bar
46; EXPORT:        - Name:            foo
47; EXPORT:        - Name:            _start
48; EXPORT-NOT:    - Name:            internal_func
49