[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / COFF / def-export-stdcall.s
blob7e4e04c77cbe7a56147efa149f82f7b9ce0b793f
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=i686-windows-msvc %s -o %t.obj
3 # RUN: echo -e "LIBRARY foo\nEXPORTS\n stdcall\n fastcall\n vectorcall\n _underscored" > %t.def
4 # RUN: lld-link -safeseh:no -entry:dllmain -dll -def:%t.def %t.obj -out:%t.dll -implib:%t.lib
5 # RUN: llvm-readobj %t.lib | FileCheck -check-prefix UNDECORATED-IMPLIB %s
6 # RUN: llvm-readobj --coff-exports %t.dll | FileCheck -check-prefix UNDECORATED-EXPORTS %s
8 # UNDECORATED-IMPLIB: Name type: noprefix
9 # UNDECORATED-IMPLIB-NEXT: Export name: _underscored
10 # UNDECORATED-IMPLIB-NEXT: __imp___underscored
11 # UNDECORATED-IMPLIB-NEXT: __underscored
12 # UNDECORATED-IMPLIB: Name type: undecorate
13 # UNDECORATED-IMPLIB-NEXT: Export name: fastcall
14 # UNDECORATED-IMPLIB-NEXT: __imp_@fastcall@8
15 # UNDECORATED-IMPLIB-NEXT: fastcall@8
16 # UNDECORATED-IMPLIB: Name type: undecorate
17 # UNDECORATED-IMPLIB-NEXT: Export name: stdcall
18 # UNDECORATED-IMPLIB-NEXT: __imp__stdcall@8
19 # UNDECORATED-IMPLIB-NEXT: _stdcall@8
20 # UNDECORATED-IMPLIB: Name type: undecorate
21 # UNDECORATED-IMPLIB-NEXT: Export name: vectorcall
22 # UNDECORATED-IMPLIB-NEXT: __imp_vectorcall@@8
23 # UNDECORATED-IMPLIB-NEXT: vectorcall@@8
25 # UNDECORATED-EXPORTS: Name: _underscored
26 # UNDECORATED-EXPORTS: Name: fastcall
27 # UNDECORATED-EXPORTS: Name: stdcall
28 # UNDECORATED-EXPORTS: Name: vectorcall
31 # RUN: echo -e "LIBRARY foo\nEXPORTS\n _stdcall@8\n @fastcall@8\n vectorcall@@8" > %t.def
32 # RUN: lld-link -safeseh:no -entry:dllmain -dll -def:%t.def %t.obj -out:%t.dll -implib:%t.lib
33 # RUN: llvm-readobj %t.lib | FileCheck -check-prefix DECORATED-IMPLIB %s
34 # RUN: llvm-readobj --coff-exports %t.dll | FileCheck -check-prefix DECORATED-EXPORTS %s
36 # DECORATED-IMPLIB: Name type: name
37 # DECORATED-IMPLIB-NEXT: Export name: @fastcall@8
38 # DECORATED-IMPLIB-NEXT: __imp_@fastcall@8
39 # DECORATED-IMPLIB-NEXT: @fastcall@8
40 # DECORATED-IMPLIB: Name type: name
41 # DECORATED-IMPLIB-NEXT: Export name: _stdcall@8
42 # DECORATED-IMPLIB-NEXT: __imp__stdcall@8
43 # DECORATED-IMPLIB-NEXT: _stdcall@8
44 # DECORATED-IMPLIB: Name type: name
45 # DECORATED-IMPLIB-NEXT: Export name: vectorcall@@8
46 # DECORATED-IMPLIB-NEXT: __imp_vectorcall@@8
47 # DECORATED-IMPLIB-NEXT: vectorcall@@8
49 # DECORATED-EXPORTS: Name: @fastcall@8
50 # DECORATED-EXPORTS: Name: _stdcall@8
51 # DECORATED-EXPORTS: Name: vectorcall@@8
54 # GNU tools don't support vectorcall at the moment, but test it for completeness.
55 # RUN: echo -e "LIBRARY foo\nEXPORTS\n stdcall@8\n @fastcall@8\n vectorcall@@8" > %t.def
56 # RUN: lld-link -lldmingw -entry:dllmain -dll -def:%t.def %t.obj -out:%t.dll -implib:%t.lib
57 # RUN: llvm-readobj %t.lib | FileCheck -check-prefix DECORATED-MINGW-IMPLIB %s
58 # RUN: llvm-readobj --coff-exports %t.dll | FileCheck -check-prefix DECORATED-MINGW-EXPORTS %s
60 # DECORATED-MINGW-IMPLIB: Name type: name
61 # DECORATED-MINGW-IMPLIB-NEXT: Export name: @fastcall@8
62 # DECORATED-MINGW-IMPLIB-NEXT: __imp_@fastcall@8
63 # DECORATED-MINGW-IMPLIB-NEXT: fastcall@8
64 # DECORATED-MINGW-IMPLIB: Name type: noprefix
65 # DECORATED-MINGW-IMPLIB-NEXT: Export name: stdcall@8
66 # DECORATED-MINGW-IMPLIB-NEXT: __imp__stdcall@8
67 # DECORATED-MINGW-IMPLIB-NEXT: _stdcall@8
68 # GNU tools don't support vectorcall, but this test is just to track that
69 # lld's behaviour remains consistent over time.
70 # DECORATED-MINGW-IMPLIB: Name type: name
71 # DECORATED-MINGW-IMPLIB-NEXT: Export name: vectorcall@@8
72 # DECORATED-MINGW-IMPLIB-NEXT: __imp_vectorcall@@8
73 # DECORATED-MINGW-IMPLIB-NEXT: vectorcall@@8
75 # DECORATED-MINGW-EXPORTS: Name: @fastcall@8
76 # DECORATED-MINGW-EXPORTS: Name: stdcall@8
77 # DECORATED-MINGW-EXPORTS: Name: vectorcall@@8
79 # RUN: lld-link -lldmingw -kill-at -entry:dllmain -dll -def:%t.def %t.obj -out:%t.dll -implib:%t.lib
80 # RUN: llvm-readobj %t.lib | FileCheck -check-prefix MINGW-KILL-AT-IMPLIB %s
81 # RUN: llvm-readobj --coff-exports %t.dll | FileCheck -check-prefix MINGW-KILL-AT-EXPORTS %s
83 # RUN: lld-link -lldmingw -kill-at -entry:dllmain -dll %t.obj -out:%t.dll -implib:%t.lib
84 # RUN: llvm-readobj %t.lib | FileCheck -check-prefix MINGW-KILL-AT-IMPLIB %s
85 # RUN: llvm-readobj --coff-exports %t.dll | FileCheck -check-prefix MINGW-KILL-AT-EXPORTS %s
87 # MINGW-KILL-AT-IMPLIB: Name type: noprefix
88 # MINGW-KILL-AT-IMPLIB: Export name: fastcall
89 # MINGW-KILL-AT-IMPLIB: __imp__fastcall
90 # MINGW-KILL-AT-IMPLIB-NEXT: _fastcall
91 # MINGW-KILL-AT-IMPLIB: Name type: noprefix
92 # MINGW-KILL-AT-IMPLIB-NEXT: Export name: stdcall
93 # MINGW-KILL-AT-IMPLIB-NEXT: __imp__stdcall
94 # MINGW-KILL-AT-IMPLIB-NEXT: _stdcall
95 # GNU tools don't support vectorcall, but this test is just to track that
96 # lld's behaviour remains consistent over time.
97 # MINGW-KILL-AT-IMPLIB: Name type: noprefix
98 # MINGW-KILL-AT-IMPLIB-NEXT: Export name: vectorcall
99 # MINGW-KILL-AT-IMPLIB-NEXT: __imp__vectorcall
100 # MINGW-KILL-AT-IMPLIB-NEXT: _vectorcall
102 # MINGW-KILL-AT-EXPORTS: Name: fastcall
103 # MINGW-KILL-AT-EXPORTS: Name: stdcall
104 # MINGW-KILL-AT-EXPORTS: Name: vectorcall
107 .def _stdcall@8;
108 .scl 2;
109 .type 32;
110 .endef
111 .globl _stdcall@8
112 .globl @fastcall@8
113 .globl vectorcall@@8
114 .globl __underscored
115 _stdcall@8:
116 movl 8(%esp), %eax
117 addl 4(%esp), %eax
118 retl $8
119 @fastcall@8:
120 movl 8(%esp), %eax
121 addl 4(%esp), %eax
122 retl $8
123 vectorcall@@8:
124 movl 8(%esp), %eax
125 addl 4(%esp), %eax
126 retl $8
127 __underscored:
130 .def _dllmain;
131 .scl 2;
132 .type 32;
133 .endef
134 .globl _dllmain
135 _dllmain:
136 retl