[lld] 1741415 - [lld-link] Tweak winsysroottest.test to have passing links on happy path

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 14 07:44:43 PDT 2022


Author: Nico Weber
Date: 2022-03-14T10:44:26-04:00
New Revision: 17414150cfa0e25656fff11d41c42294a03b07a1

URL: https://github.com/llvm/llvm-project/commit/17414150cfa0e25656fff11d41c42294a03b07a1
DIFF: https://github.com/llvm/llvm-project/commit/17414150cfa0e25656fff11d41c42294a03b07a1.diff

LOG: [lld-link] Tweak winsysroottest.test to have passing links on happy path

Previously, the test checked for a "undefined symbol" error
(instead of the "could not open std*.lib" which would happen without
the flag).

Instead, use /entry: so that the link succeeds.

No behavior change, but maybe makes the test a bit easier to understand.

Differential Revision: https://reviews.llvm.org/D121553

Added: 
    

Modified: 
    lld/test/COFF/winsysroot.test

Removed: 
    


################################################################################
diff  --git a/lld/test/COFF/winsysroot.test b/lld/test/COFF/winsysroot.test
index 5abcbce3548e9..f09ceb5c92805 100644
--- a/lld/test/COFF/winsysroot.test
+++ b/lld/test/COFF/winsysroot.test
@@ -5,12 +5,12 @@ being searched for the defaultlibs, for a 32-bit .obj.
 # RUN: mkdir -p %t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x64
 # RUN: cp %p/Inputs/std32.lib %t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x86
 # RUN: cp %p/Inputs/std64.lib %t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x64
-# RUN: not lld-link %t.obj /winsysroot:%t.dir/sysroot /defaultlib:std32 2>&1 | FileCheck -check-prefix=MISSINGENTRY32 --implicit-check-not=_ExitProcess %s
-MISSINGENTRY32: undefined symbol: _mainCRTStartup
+# RUN: lld-link %t.obj /winsysroot:%t.dir/sysroot \
+# RUN:          /defaultlib:std32 /entry:main at 0
 
 Check the same for a 64-bit input .obj.
-# RUN: not lld-link %p/Inputs/hello64.obj /winsysroot:%t.dir/sysroot /defaultlib:std64 2>&1 | FileCheck -check-prefix=MISSINGENTRY64 --implicit-check-not=_ExitProcess %s
-MISSINGENTRY64: undefined symbol: mainCRTStartup
+# RUN: lld-link %p/Inputs/hello64.obj /winsysroot:%t.dir/sysroot \
+# RUN:          /defaultlib:std64 /entry:main
 
 Check that when /winsysroot is specified, %LIB% is ignored.
 # RUN: env LIB=foo.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x86 not lld-link %t.obj /winsysroot:%t.dir/doesnotexist /defaultlib:std32 2>&1 | FileCheck -check-prefix=LIBIGNORED %s


        


More information about the llvm-commits mailing list