From aa89ceab485cd8d5ff1e11dd67a479741ed1f6dd Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Tue, 18 Oct 2022 08:46:14 -0700 Subject: [PATCH] [win][compiler-rt] Make tests use lld-link instead of link Git bash ships with a link.exe. We try to add git bash to the beginning of PATH (see D84380). These tests end up executing the wrong link.exe. As a workaround, use lld-link. Note that `REQUIRES: lld-available` tests currently aren't running, see D128567. I did manually verify that these tests pass with lld-link. Reviewed By: rnk, hans Differential Revision: https://reviews.llvm.org/D136108 --- compiler-rt/test/asan/TestCases/Windows/dll_and_lib.cpp | 5 +++-- .../test/asan/TestCases/Windows/dll_large_function.cpp | 3 ++- compiler-rt/test/asan/TestCases/Windows/unsymbolized.cpp | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_and_lib.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_and_lib.cpp index bddaa32df73be..96fae6b1d6039 100644 --- a/compiler-rt/test/asan/TestCases/Windows/dll_and_lib.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/dll_and_lib.cpp @@ -1,10 +1,11 @@ // Just make sure we can link an implib into another DLL // This used to fail between r212699 and r212814. // RUN: %clang_cl_asan -DCONFIG=1 %s -c -Fo%t.1.obj -// RUN: link /nologo /DLL /OUT:%t.1.dll %t.1.obj %asan_dll_thunk +// RUN: lld-link /nologo /DLL /OUT:%t.1.dll %t.1.obj %asan_dll_thunk // RUN: %clang_cl_asan -DCONFIG=2 %s -c -Fo%t.2.obj -// RUN: link /nologo /DLL /OUT:%t.2.dll %t.2.obj %t.1.lib %asan_dll_thunk +// RUN: lld-link /nologo /DLL /OUT:%t.2.dll %t.2.obj %t.1.lib %asan_dll_thunk // REQUIRES: asan-static-runtime +// REQUIRES: lld-available #if CONFIG==1 extern "C" __declspec(dllexport) int f1() { diff --git a/compiler-rt/test/asan/TestCases/Windows/dll_large_function.cpp b/compiler-rt/test/asan/TestCases/Windows/dll_large_function.cpp index 039d01f84ba56..788488dbb8ed8 100644 --- a/compiler-rt/test/asan/TestCases/Windows/dll_large_function.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/dll_large_function.cpp @@ -3,8 +3,9 @@ // from the DLL. We simulate the large function with // -mllvm -asan-instrumentation-with-call-threshold=0. // RUN: %clang_cl_asan %s -c -Fo%t.obj -mllvm -asan-instrumentation-with-call-threshold=0 -// RUN: link /nologo /DLL /OUT:%t.dll %t.obj %asan_dll_thunk +// RUN: lld-link /nologo /DLL /OUT:%t.dll %t.obj %asan_dll_thunk // REQUIRES: asan-static-runtime +// REQUIRES: lld-available void f(long* foo, long* bar) { // One load and one store diff --git a/compiler-rt/test/asan/TestCases/Windows/unsymbolized.cpp b/compiler-rt/test/asan/TestCases/Windows/unsymbolized.cpp index 2c45258016f0f..0eb1e9ee91b0a 100644 --- a/compiler-rt/test/asan/TestCases/Windows/unsymbolized.cpp +++ b/compiler-rt/test/asan/TestCases/Windows/unsymbolized.cpp @@ -4,8 +4,9 @@ // RUN: rm -f %t.pdb // RUN: %clangxx_asan -c -O2 %s -o %t.obj -// RUN: link /nologo /OUT:%t.exe %t.obj %asan_lib %asan_cxx_lib +// RUN: lld-link /nologo /OUT:%t.exe %t.obj %asan_lib %asan_cxx_lib // RUN: not %run %t.exe 2>&1 | FileCheck %s +// REQUIRES: lld-available #include #include