Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / COFF / def-export-cpp.s
blobe00b35b1c5b39bb8d32ed1b80b74e15473b3196b
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
11 # IMPLIB: File: foo.dll
12 # IMPLIB: Name type: undecorate
13 # IMPLIB-NEXT: Symbol: __imp_?GetPathOnDisk@@YA_NPEA_W@Z
14 # IMPLIB-NEXT: Symbol: ?GetPathOnDisk@@YA_NPEA_W@Z
16 # EXPORTS: Name: GetPathOnDisk
18 #--- path.s
20 .def "?GetPathOnDisk@@YA_NPEA_W@Z";
21 .scl 2;
22 .type 32;
23 .endef
24 .globl "?GetPathOnDisk@@YA_NPEA_W@Z"
25 "?GetPathOnDisk@@YA_NPEA_W@Z":
26 retq
28 #--- dllmain.s
30 .def dllmain;
31 .scl 2;
32 .type 32;
33 .endef
34 .globl dllmain
35 dllmain:
36 retq