Rename CODE_OWNERS -> Maintainers (#114544)
[llvm-project.git] / lld / test / COFF / includeoptional-export.s
blobed84f0b972e4d78c56fe6755567390a271fbcd32
1 // REQUIRES: x86
2 // RUN: split-file %s %t.dir
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
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
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
16 // CHECK-DEFAULT: Name: myfunc
18 // CHECK-INCLUDEOPTIONAL: Name: libfunc
19 // CHECK-INCLUDEOPTIONAL: Name: myfunc
20 // CHECK-INCLUDEOPTIONAL: Name: otherlibfunc
22 #--- main.s
23 .global entry
24 entry:
25 ret
27 .global myfunc
28 myfunc:
29 ret
31 .section .drectve
32 .ascii "-export:myfunc "
34 #--- lib1.s
35 .global libfunc
36 libfunc:
37 call otherlibfunc
38 ret
40 .section .drectve
41 .ascii "-export:libfunc "
43 #--- lib2.s
44 .global otherlibfunc
45 otherlibfunc:
46 ret
48 .section .drectve
49 .ascii "-export:otherlibfunc "