llvm-project
49 строк · 1.2 Кб
1// REQUIRES: x86
2// RUN: split-file %s %t.dir
3
4// RUN: llvm-mc -filetype=obj -triple=x86_64-win32-gnu %t.dir/main.s -o %t.main.o
5// RUN: llvm-mc -filetype=obj -triple=x86_64-win32-gnu %t.dir/lib1.s -o %t.lib1.o
6// RUN: llvm-mc -filetype=obj -triple=x86_64-win32-gnu %t.dir/lib2.s -o %t.lib2.o
7
8// RUN: rm -f %t.lib.a
9// RUN: llvm-ar cru %t.lib.a %t.lib1.o %t.lib2.o
10// RUN: lld-link -dll -out:%t-1.dll -entry:entry %t.main.o %t.lib.a
11// RUN: lld-link -dll -out:%t-2.dll -entry:entry %t.main.o %t.lib.a -includeoptional:libfunc
12
13// RUN: llvm-readobj --coff-exports %t-1.dll | FileCheck --implicit-check-not=Name: %s --check-prefix=CHECK-DEFAULT
14// RUN: llvm-readobj --coff-exports %t-2.dll | FileCheck --implicit-check-not=Name: %s --check-prefix=CHECK-INCLUDEOPTIONAL
15
16// CHECK-DEFAULT: Name: myfunc
17
18// CHECK-INCLUDEOPTIONAL: Name: libfunc
19// CHECK-INCLUDEOPTIONAL: Name: myfunc
20// CHECK-INCLUDEOPTIONAL: Name: otherlibfunc
21
22#--- main.s
23.global entry
24entry:
25ret
26
27.global myfunc
28myfunc:
29ret
30
31.section .drectve
32.ascii "-export:myfunc "
33
34#--- lib1.s
35.global libfunc
36libfunc:
37call otherlibfunc
38ret
39
40.section .drectve
41.ascii "-export:libfunc "
42
43#--- lib2.s
44.global otherlibfunc
45otherlibfunc:
46ret
47
48.section .drectve
49.ascii "-export:otherlibfunc "
50