[lld] r304572 - Add test case for LLD/COFF for stdcall exports in .def files

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 2 10:48:06 PDT 2017


Author: rnk
Date: Fri Jun  2 12:48:06 2017
New Revision: 304572

URL: http://llvm.org/viewvc/llvm-project?rev=304572&view=rev
Log:
Add test case for LLD/COFF for stdcall exports in .def files

The .def file parser changes I reverted broke this test case, and
exported "__imp__foo" instead of "__imp__foo at 8". This was
http://crbug.com/728726.

Added:
    lld/trunk/test/COFF/def-export-stdcall.s

Added: lld/trunk/test/COFF/def-export-stdcall.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/COFF/def-export-stdcall.s?rev=304572&view=auto
==============================================================================
--- lld/trunk/test/COFF/def-export-stdcall.s (added)
+++ lld/trunk/test/COFF/def-export-stdcall.s Fri Jun  2 12:48:06 2017
@@ -0,0 +1,25 @@
+# RUN: llvm-mc -filetype=obj -triple=i686-windows-msvc %s -o %t.obj
+# RUN: echo -e "LIBRARY foo\nEXPORTS\n  stdcall" > %t.def
+# RUN: lld-link -entry:dllmain -dll -def:%t.def %t.obj -out:%t.dll -implib:%t.lib
+# RUN: llvm-nm %t.lib | FileCheck %s
+# CHECK: __imp__stdcall at 8
+# CHECK: _stdcall at 8
+
+        .def     _stdcall at 8;
+        .scl    2;
+        .type   32;
+        .endef
+        .globl  _stdcall at 8
+_stdcall at 8:
+        movl    8(%esp), %eax
+        addl    4(%esp), %eax
+        retl    $8
+
+        .def     _dllmain;
+        .scl    2;
+        .type   32;
+        .endef
+        .globl  _dllmain
+_dllmain:
+        retl
+




More information about the llvm-commits mailing list