Files
clang-p2996/lld/test/COFF/winsysroot.test
Nico Weber 17414150cf [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
2022-03-14 10:44:26 -04:00

18 lines
982 B
Plaintext

Check that /winsysroot results in the correct machine-specific subdirectory
being searched for the defaultlibs, for a 32-bit .obj.
# RUN: yaml2obj %p/Inputs/hello32.yaml -o %t.obj
# RUN: mkdir -p %t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x86
# 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: lld-link %t.obj /winsysroot:%t.dir/sysroot \
# RUN: /defaultlib:std32 /entry:main@0
Check the same for a 64-bit input .obj.
# 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
LIBIGNORED: could not open 'std32.lib'