[compiler-rt] 94f216a - [compiler-rt] Adjust ASan Windows tests for mingw-w64 (#216585)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 21 11:12:52 PDT 2026
Author: oltolm
Date: 2026-08-21T11:12:47-07:00
New Revision: 94f216a9cf0e69db996fd573b764cc00d88eba02
URL: https://github.com/llvm/llvm-project/commit/94f216a9cf0e69db996fd573b764cc00d88eba02
DIFF: https://github.com/llvm/llvm-project/commit/94f216a9cf0e69db996fd573b764cc00d88eba02.diff
LOG: [compiler-rt] Adjust ASan Windows tests for mingw-w64 (#216585)
Add MinGW-specific configurations to the fuse-lld and unsymbolized
tests. Use the Clang driver and GNU-compatible LLD options instead of
the MSVC-oriented lld-link invocation, and account for differences in
the resulting symbolization output.
This change was split out of
https://github.com/llvm/llvm-project/pull/209902, which adds GCC support
to the sanitizer runtimes on Windows.
---------
Co-authored-by: Hannes Domani <ssbssa at yahoo.de>
Added:
Modified:
compiler-rt/test/asan/TestCases/Windows/fuse-lld.cpp
compiler-rt/test/asan/TestCases/Windows/unsymbolized.cpp
Removed:
################################################################################
diff --git a/compiler-rt/test/asan/TestCases/Windows/fuse-lld.cpp b/compiler-rt/test/asan/TestCases/Windows/fuse-lld.cpp
index 5fa5945df4dc0..ea107f4df13ad 100644
--- a/compiler-rt/test/asan/TestCases/Windows/fuse-lld.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/fuse-lld.cpp
@@ -2,7 +2,7 @@
//
// REQUIRES: lld-available
//
-// RUN: %clangxx_asan -O2 %s -o %t.exe -g -gcodeview -fuse-ld=lld -Wl,-debug
+// RUN: %clangxx_asan %if target={{.*-windows-gnu}} %{ -gcodeview -gcolumn-info -Wl,--pdb= -Wl,-S %} %else %{ -g -gcodeview -Wl,-debug %} -O2 %s -o %t.exe -fuse-ld=lld
// RUN: not %run %t.exe 2>&1 | FileCheck %s
#include <stdlib.h>
diff --git a/compiler-rt/test/asan/TestCases/Windows/unsymbolized.cpp b/compiler-rt/test/asan/TestCases/Windows/unsymbolized.cpp
index ade5e5b914be8..1a095612b94c1 100644
--- a/compiler-rt/test/asan/TestCases/Windows/unsymbolized.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/unsymbolized.cpp
@@ -3,8 +3,12 @@
// which is the default image base of an executable.
// RUN: rm -f %t.pdb
-// RUN: %clangxx_asan -c -O2 %s -o %t.obj
-// RUN: lld-link /nologo /OUT:%t.exe %t.obj -defaultlib:libcmt -nodefaultlib:msvcrt -defaultlib:oldnames %asan_static_runtime_thunk %asan_lib
+// RUN: %if target={{.*-windows-gnu}} %{ \
+// RUN: %clangxx_asan -O2 %s -o %t.exe -fuse-ld=lld -Wl,-s \
+// RUN: %} %else %{ \
+// RUN: %clangxx_asan -c -O2 %s -o %t.obj && \
+// RUN: lld-link /nologo /OUT:%t.exe %t.obj -defaultlib:libcmt -nodefaultlib:msvcrt -defaultlib:oldnames %asan_static_runtime_thunk %asan_lib \
+// RUN: %}
// RUN: not %run %t.exe 2>&1 | FileCheck %s
// REQUIRES: lld-available
More information about the llvm-commits
mailing list