138 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=i686-windows-msvc %s -o %t.obj3# RUN: echo -e "LIBRARY foo\nEXPORTS\n stdcall\n fastcall\n vectorcall\n _underscored" > %t.def4# RUN: lld-link -safeseh:no -entry:dllmain -dll -def:%t.def %t.obj -out:%t.dll -implib:%t.lib5# RUN: llvm-readobj %t.lib | FileCheck -check-prefix UNDECORATED-IMPLIB %s6# RUN: llvm-readobj --coff-exports %t.dll | FileCheck -check-prefix UNDECORATED-EXPORTS %s7 8# UNDECORATED-IMPLIB: Name type: noprefix9# UNDECORATED-IMPLIB-NEXT: Export name: _underscored10# UNDECORATED-IMPLIB-NEXT: __imp___underscored11# UNDECORATED-IMPLIB-NEXT: __underscored12# UNDECORATED-IMPLIB: Name type: undecorate13# UNDECORATED-IMPLIB-NEXT: Export name: fastcall14# UNDECORATED-IMPLIB-NEXT: __imp_@fastcall@815# UNDECORATED-IMPLIB-NEXT: fastcall@816# UNDECORATED-IMPLIB: Name type: undecorate17# UNDECORATED-IMPLIB-NEXT: Export name: stdcall18# UNDECORATED-IMPLIB-NEXT: __imp__stdcall@819# UNDECORATED-IMPLIB-NEXT: _stdcall@820# UNDECORATED-IMPLIB: Name type: undecorate21# UNDECORATED-IMPLIB-NEXT: Export name: vectorcall22# UNDECORATED-IMPLIB-NEXT: __imp_vectorcall@@823# UNDECORATED-IMPLIB-NEXT: vectorcall@@824 25# UNDECORATED-EXPORTS: Name: _underscored26# UNDECORATED-EXPORTS: Name: fastcall27# UNDECORATED-EXPORTS: Name: stdcall28# UNDECORATED-EXPORTS: Name: vectorcall29 30 31# RUN: echo -e "LIBRARY foo\nEXPORTS\n _stdcall@8\n @fastcall@8\n vectorcall@@8" > %t.def32# RUN: lld-link -safeseh:no -entry:dllmain -dll -def:%t.def %t.obj -out:%t.dll -implib:%t.lib33# RUN: llvm-readobj %t.lib | FileCheck -check-prefix DECORATED-IMPLIB %s34# RUN: llvm-readobj --coff-exports %t.dll | FileCheck -check-prefix DECORATED-EXPORTS %s35 36# DECORATED-IMPLIB: Name type: name37# DECORATED-IMPLIB-NEXT: Export name: @fastcall@838# DECORATED-IMPLIB-NEXT: __imp_@fastcall@839# DECORATED-IMPLIB-NEXT: @fastcall@840# DECORATED-IMPLIB: Name type: name41# DECORATED-IMPLIB-NEXT: Export name: _stdcall@842# DECORATED-IMPLIB-NEXT: __imp__stdcall@843# DECORATED-IMPLIB-NEXT: _stdcall@844# DECORATED-IMPLIB: Name type: name45# DECORATED-IMPLIB-NEXT: Export name: vectorcall@@846# DECORATED-IMPLIB-NEXT: __imp_vectorcall@@847# DECORATED-IMPLIB-NEXT: vectorcall@@848 49# DECORATED-EXPORTS: Name: @fastcall@850# DECORATED-EXPORTS: Name: _stdcall@851# DECORATED-EXPORTS: Name: vectorcall@@852 53 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.def56# RUN: lld-link -lldmingw -entry:dllmain -dll -def:%t.def %t.obj -out:%t.dll -implib:%t.lib57# RUN: llvm-readobj %t.lib | FileCheck -check-prefix DECORATED-MINGW-IMPLIB %s58# RUN: llvm-readobj --coff-exports %t.dll | FileCheck -check-prefix DECORATED-MINGW-EXPORTS %s59 60# DECORATED-MINGW-IMPLIB: Name type: name61# DECORATED-MINGW-IMPLIB-NEXT: Export name: @fastcall@862# DECORATED-MINGW-IMPLIB-NEXT: __imp_@fastcall@863# DECORATED-MINGW-IMPLIB-NEXT: fastcall@864# DECORATED-MINGW-IMPLIB: Name type: noprefix65# DECORATED-MINGW-IMPLIB-NEXT: Export name: stdcall@866# DECORATED-MINGW-IMPLIB-NEXT: __imp__stdcall@867# DECORATED-MINGW-IMPLIB-NEXT: _stdcall@868# GNU tools don't support vectorcall, but this test is just to track that69# lld's behaviour remains consistent over time.70# DECORATED-MINGW-IMPLIB: Name type: name71# DECORATED-MINGW-IMPLIB-NEXT: Export name: vectorcall@@872# DECORATED-MINGW-IMPLIB-NEXT: __imp_vectorcall@@873# DECORATED-MINGW-IMPLIB-NEXT: vectorcall@@874 75# DECORATED-MINGW-EXPORTS: Name: @fastcall@876# DECORATED-MINGW-EXPORTS: Name: stdcall@877# DECORATED-MINGW-EXPORTS: Name: vectorcall@@878 79# RUN: lld-link -lldmingw -kill-at -entry:dllmain -dll -def:%t.def %t.obj -out:%t.dll -implib:%t.lib80# RUN: llvm-readobj %t.lib | FileCheck -check-prefix MINGW-KILL-AT-IMPLIB %s81# RUN: llvm-readobj --coff-exports %t.dll | FileCheck -check-prefix MINGW-KILL-AT-EXPORTS %s82 83# RUN: lld-link -lldmingw -kill-at -entry:dllmain -dll %t.obj -out:%t.dll -implib:%t.lib84# RUN: llvm-readobj %t.lib | FileCheck -check-prefix MINGW-KILL-AT-IMPLIB %s85# RUN: llvm-readobj --coff-exports %t.dll | FileCheck -check-prefix MINGW-KILL-AT-EXPORTS %s86 87# MINGW-KILL-AT-IMPLIB: Name type: noprefix88# MINGW-KILL-AT-IMPLIB: Export name: fastcall89# MINGW-KILL-AT-IMPLIB: __imp__fastcall90# MINGW-KILL-AT-IMPLIB-NEXT: _fastcall91# MINGW-KILL-AT-IMPLIB: Name type: noprefix92# MINGW-KILL-AT-IMPLIB-NEXT: Export name: stdcall93# MINGW-KILL-AT-IMPLIB-NEXT: __imp__stdcall94# MINGW-KILL-AT-IMPLIB-NEXT: _stdcall95# GNU tools don't support vectorcall, but this test is just to track that96# lld's behaviour remains consistent over time.97# MINGW-KILL-AT-IMPLIB: Name type: noprefix98# MINGW-KILL-AT-IMPLIB-NEXT: Export name: vectorcall99# MINGW-KILL-AT-IMPLIB-NEXT: __imp__vectorcall100# MINGW-KILL-AT-IMPLIB-NEXT: _vectorcall101 102# MINGW-KILL-AT-EXPORTS: Name: fastcall103# MINGW-KILL-AT-EXPORTS: Name: stdcall104# MINGW-KILL-AT-EXPORTS: Name: vectorcall105 106 107 .def _stdcall@8;108 .scl 2;109 .type 32;110 .endef111 .globl _stdcall@8112 .globl @fastcall@8113 .globl vectorcall@@8114 .globl __underscored115_stdcall@8:116 movl 8(%esp), %eax117 addl 4(%esp), %eax118 retl $8119@fastcall@8:120 movl 8(%esp), %eax121 addl 4(%esp), %eax122 retl $8123vectorcall@@8:124 movl 8(%esp), %eax125 addl 4(%esp), %eax126 retl $8127__underscored:128 ret129 130 .def _dllmain;131 .scl 2;132 .type 32;133 .endef134 .globl _dllmain135_dllmain:136 retl137 138