]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/wasm/archive-export.ll
Vendor import of lld trunk r351319 (just before the release_80 branch
[FreeBSD/FreeBSD.git] / test / wasm / archive-export.ll
1 Test that --export will also fetch lazy symbols from archives
2
3 RUN: llc -filetype=obj %S/Inputs/start.ll -o %t.o
4 RUN: llc -filetype=obj %S/Inputs/archive1.ll -o %t.a1.o
5 RUN: llc -filetype=obj %S/Inputs/archive2.ll -o %t.a2.o
6 RUN: rm -f %t.a
7 RUN: llvm-ar rcs %t.a %t.a1.o %t.a2.o
8 RUN: wasm-ld --export-dynamic --export=archive2_symbol -o %t.wasm %t.a %t.o
9 RUN: obj2yaml %t.wasm | FileCheck %s
10 RUN: wasm-ld --export-dynamic -o %t.wasm %t.a %t.o
11 RUN: obj2yaml %t.wasm | FileCheck %s -check-prefix=NOEXPORT
12
13 CHECK:         Exports:
14 CHECK-NEXT:       - Name:            memory
15 CHECK-NEXT:         Kind:            MEMORY
16 CHECK-NEXT:         Index:           0
17 CHECK-NEXT:       - Name:            __heap_base
18 CHECK-NEXT:         Kind:            GLOBAL
19 CHECK-NEXT:         Index:           1
20 CHECK-NEXT:       - Name:            __data_end
21 CHECK-NEXT:         Kind:            GLOBAL
22 CHECK-NEXT:         Index:           2
23 CHECK-NEXT:       - Name:            foo
24 CHECK-NEXT:         Kind:            FUNCTION
25 CHECK-NEXT:         Index:           2
26 CHECK-NEXT:       - Name:            bar
27 CHECK-NEXT:         Kind:            FUNCTION
28 CHECK-NEXT:         Index:           3
29 CHECK-NEXT:       - Name:            archive2_symbol
30 CHECK-NEXT:         Kind:            FUNCTION
31 CHECK-NEXT:         Index:           4
32 CHECK-NEXT:       - Name:            _start
33 CHECK-NEXT:         Kind:            FUNCTION
34 CHECK-NEXT:         Index:           1
35 CHECK-NEXT:   - Type:            CODE
36
37 NOEXPORT:         Exports:
38 NOEXPORT-NEXT:       - Name:            memory
39 NOEXPORT-NEXT:         Kind:            MEMORY
40 NOEXPORT-NEXT:         Index:           0
41 NOEXPORT-NEXT:       - Name:            __heap_base
42 NOEXPORT-NEXT:         Kind:            GLOBAL
43 NOEXPORT-NEXT:         Index:           1
44 NOEXPORT-NEXT:       - Name:            __data_end
45 NOEXPORT-NEXT:         Kind:            GLOBAL
46 NOEXPORT-NEXT:         Index:           2
47 NOEXPORT-NEXT:       - Name:            _start
48 NOEXPORT-NEXT:         Kind:            FUNCTION
49 NOEXPORT-NEXT:         Index:           1
50 NOEXPORT-NEXT:   - Type:            CODE