[lld] [LLD][COFF] Update nodefaultlibs after updating search paths (PR #128813)
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 11 05:57:25 PDT 2025
================
@@ -36,3 +36,8 @@ MSVC stamps uppercase references in OBJ directives, thus ensure that passing low
UPPERCASE-NOT: OLDNAMES
UPPERCASE-NOT: LIBCMT
+
+# RUN: yaml2obj -o %T/defaultlib.obj %p/Inputs/defaultlib.yaml
+# RUN: mkdir -p %t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x64
+# RUN: cp %p/Inputs/ret42.lib %t.dir/sysroot/VC/Tools/MSVC/1.1.1.1/lib/x64/default.lib
+# RUN: not lld-link /winsysroot:%t.dir/sysroot /out:%t.exe /entry:main /subsystem:console /nodefaultlib:default.lib %T/defaultlib.obj
----------------
mstorsjo wrote:
Yes, I'm sure there are other tests that validate that, but the point here is to make sure that the test setup within this testcase actually works as intended. It's easy to make a typo, which makes the `not lld-link` case fail in an unexpected way.
Actually, it could be good to check that we actually get the right error here as well. To do that, change the `not lld-link` case into `env LLD_IN_TEST=1 not lld-link [...options...] 2>&1 | FileCheck %s --check-prefix=NODEFAULTLIB`, and check that we actually get the right error - `undefined symbol: main` in this case.
https://github.com/llvm/llvm-project/pull/128813
More information about the llvm-commits
mailing list