65 lines · plain
1Check that /winsysroot results in the correct machine-specific subdirectory2being searched for the defaultlibs, for a 32-bit .obj.3# RUN: yaml2obj %p/Inputs/hello32.yaml -o %t.obj4# RUN: mkdir -p %t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x865# RUN: mkdir -p %t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x646# RUN: cp %p/Inputs/std32.lib %t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x867# RUN: cp %p/Inputs/std64.lib %t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x648# RUN: lld-link %t.obj /winsysroot:%t.dir/sysroot \9# RUN: /defaultlib:std32 /entry:main@010 11Check the same for a 64-bit input .obj.12# RUN: lld-link %p/Inputs/hello64.obj /winsysroot:%t.dir/sysroot \13# RUN: /defaultlib:std64 /entry:main14 15Check directly passed lib with /machine:16# RUN: lld-link %p/Inputs/hello64.obj /winsysroot:%t.dir/sysroot /machine:x64 \17# RUN: std64.lib /entry:main18 19# RUN: lld-link %t.obj /winsysroot:%t.dir/sysroot /machine:x86 \20# RUN: std32.lib /entry:main21 22Check directly passed lib without /machine: (should infer from obj arch)23# RUN: lld-link %p/Inputs/hello64.obj /winsysroot:%t.dir/sysroot \24# RUN: std64.lib /entry:main25 26# RUN: lld-link %t.obj /winsysroot:%t.dir/sysroot \27# RUN: std32.lib /entry:main28 29Check that passing a lib from /winsysroot twice is ok30# RUN: lld-link %p/Inputs/hello64.obj /winsysroot:%t.dir/sysroot \31# RUN: std64.lib std64.lib /entry:main32 33Check unknown library34# RUN: not lld-link %p/Inputs/hello64.obj /winsysroot:%t.dir/sysroot \35# RUN: notfound.lib /entry:main 2>&1 | FileCheck --check-prefix=UNKNOWNLIB %s36UNKNOWNLIB: could not open 'notfound.lib'37 38If winsysroot lib appears before we can detect arch we don't find it39# RUN: not lld-link std64.lib %p/Inputs/hello64.obj /winsysroot:%t.dir/sysroot \40# RUN: /entry:main 2>&1 | FileCheck --check-prefix=NO64 %s41 42Check we don't choose the wrong arch43# RUN: not lld-link %t.obj /winsysroot:%t.dir/sysroot \44# RUN: std64.lib /entry:main 2>&1 | FileCheck --check-prefix=NO64 %s45NO64: could not open 'std64.lib'46 47# RUN: not lld-link %p/Inputs/hello64.obj /winsysroot:%t.dir/sysroot \48# RUN: std32.lib /entry:main 2>&1 | FileCheck --check-prefix=NO32 %s49NO32: could not open 'std32.lib'50 51Check that when /winsysroot is specified, %LIB% is ignored.52# RUN: env LIB=%t.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 %s53LIBIGNORED: could not open 'std32.lib'54 55Check that when -lldmingw is specified, %LIB% is ignored.56# RUN: env LIB=%t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x86 not lld-link -lldmingw %t.obj /defaultlib:std32 2>&1 | FileCheck -check-prefix=LIBIGNORED_MINGW %s57LIBIGNORED_MINGW: could not open 'libstd32.a'58 59# RUN: not lld-link -lldmingw %t.obj /defaultlib:std32 /winsysroot:%t.dir/sysroot 2>&1 | FileCheck -check-prefix=IGNORED_ARG %s60IGNORED_ARG: warning: ignoring /vctoolsdir or /winsysroot flags in MinGW mode61 62Check that when /winsdkversion is specified, %LIB% is ignored.63# RUN: env LIB=%t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x86 not lld-link %t.obj /winsdkversion:99.99.9999.9 /defaultlib:std32 2>&1 | FileCheck -check-prefix=WINSDKVERSION %s64WINSDKVERSION: could not open 'std32.lib'65