llvm-project
37 строк · 1.1 Кб
1# REQUIRES: x86
2# RUN: split-file %s %t
3# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc %t/dllmain.s -o %t/dllmain.obj
4# RUN: llvm-mc -filetype=obj -triple=x86_64-windows-msvc %t/path.s -o %t/path.obj
5# RUN: lld-link -lib %t/dllmain.obj -out:%t/archive.lib
6# RUN: echo -e "LIBRARY foo\nEXPORTS\n GetPathOnDisk" > %t.def
7# RUN: lld-link -entry:dllmain -dll -def:%t.def %t/path.obj %t/archive.lib -out:%t/foo.dll -implib:%t/foo.lib
8# RUN: llvm-readobj %t/foo.lib | FileCheck -check-prefix IMPLIB %s
9# RUN: llvm-readobj --coff-exports %t/foo.dll | FileCheck -check-prefix EXPORTS %s
10
11# IMPLIB: File: foo.dll
12# IMPLIB: Name type: undecorate
13# IMPLIB-NEXT: Export name: GetPathOnDisk
14# IMPLIB-NEXT: Symbol: __imp_?GetPathOnDisk@@YA_NPEA_W@Z
15# IMPLIB-NEXT: Symbol: ?GetPathOnDisk@@YA_NPEA_W@Z
16
17# EXPORTS: Name: GetPathOnDisk
18
19#--- path.s
20
21.def "?GetPathOnDisk@@YA_NPEA_W@Z";
22.scl 2;
23.type 32;
24.endef
25.globl "?GetPathOnDisk@@YA_NPEA_W@Z"
26"?GetPathOnDisk@@YA_NPEA_W@Z":
27retq
28
29#--- dllmain.s
30
31.def dllmain;
32.scl 2;
33.type 32;
34.endef
35.globl dllmain
36dllmain:
37retq
38