[Dexter][NFC] Add Missing Commands to Commands.md Contents
[llvm-project.git] / lld / test / COFF / dll.test
blob05f6b4fa9c25416f710e49229b03fb9f4221c926
1 # REQUIRES: x86
2 # RUN: yaml2obj %p/Inputs/export.yaml -o %t.obj
3 # RUN: lld-link /out:%t.dll /dll %t.obj /export:exportfn1 /export:exportfn2 \
4 # RUN:   /export:mangled
5 # RUN: llvm-objdump -p %t.dll | FileCheck --check-prefix=EXPORT %s
7 EXPORT:      Export Table:
8 EXPORT:      DLL name: dll.test.tmp.dll
9 EXPORT:      Ordinal      RVA  Name
10 EXPORT-NEXT:       0        0
11 EXPORT-NEXT:       1   0x1008  exportfn1
12 EXPORT-NEXT:       2   0x1010  exportfn2
13 EXPORT-NEXT:       3   0x1010  exportfn3
14 EXPORT-NEXT:       4   0x1010  mangled
16 # RUN: yaml2obj %p/Inputs/export2.yaml -o %t4.obj
17 # RUN: rm -f %t4.lib
18 # RUN: llvm-ar cru %t4.lib %t4.obj
19 # RUN: lld-link /out:%t5.dll /dll %t.obj %t4.lib /export:mangled2
20 # RUN: llvm-objdump -p %t5.dll | FileCheck --check-prefix=EXPORT2 %s
22 EXPORT2:      Export Table:
23 EXPORT2:      DLL name: dll.test.tmp5.dll
24 EXPORT2:      Ordinal      RVA  Name
25 EXPORT2-NEXT:       0        0
26 EXPORT2-NEXT:       1   0x1010  exportfn3
27 EXPORT2-NEXT:       2   0x101c  mangled2
29 # RUN: llvm-as -o %t.lto.obj %p/Inputs/export.ll
30 # RUN: lld-link -opt:noicf /out:%t.lto.dll /dll %t.lto.obj /export:exportfn1 /export:exportfn2
31 # RUN: llvm-objdump -p %t.lto.dll | FileCheck --check-prefix=EXPORT-LTO %s
33 EXPORT-LTO:      Export Table:
34 EXPORT-LTO:      DLL name: dll.test.tmp.lto.dll
35 EXPORT-LTO:      Ordinal      RVA  Name
36 EXPORT-LTO-NEXT:       0        0
37 EXPORT-LTO-NEXT:       1   0x1010  exportfn1
38 EXPORT-LTO-NEXT:       2   0x1020  exportfn2
39 EXPORT-LTO-NEXT:       3   0x1030  exportfn3
41 # RUN: lld-link /out:%t.dll /dll %t.obj /implib:%t2.lib \
42 # RUN:   /export:exportfn1 /export:exportfn2
43 # RUN: yaml2obj %p/Inputs/import.yaml -o %t2.obj
44 # RUN: lld-link /out:%t2.exe /entry:main %t2.obj %t2.lib
45 # RUN: llvm-readobj --coff-imports %t2.exe | FileCheck -check-prefix=IMPORT %s
47 # RUN: lld-link /out:%t2.lto.exe /entry:main %t2.obj %t.lto.lib
48 # RUN: llvm-readobj --coff-imports %t2.lto.exe | FileCheck -check-prefix=IMPORT %s
50 IMPORT: Symbol: exportfn1
51 IMPORT: Symbol: exportfn2