[compiler-rt] [compiler-rt] [test] Work around MS CRT stdio format quirks on mingw too (PR #93787)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Thu May 30 01:40:10 PDT 2024


https://github.com/mstorsjo created https://github.com/llvm/llvm-project/pull/93787

So far, these tests have been disabled in mingw build configurations (built as asan-dynamic), but these were enabled in 246234ac70faa1e3281a2bb83dfc4dd206a7d59c, exposing the issue.

(That commit is currently reverted, but will probably be relanded in some form soon.)

>From cc6f0cf1088079efd7b4f61199cbdcf245da9ec1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
Date: Thu, 30 May 2024 10:49:39 +0300
Subject: [PATCH] [compiler-rt] [test] Work around MS CRT stdio format quirks
 on mingw too

So far, these tests have been disabled in mingw build configurations
(built as asan-dynamic), but these were enabled in
246234ac70faa1e3281a2bb83dfc4dd206a7d59c, exposing the issue.

(That commit is currently reverted, but will probably be relanded
in some form soon.)
---
 compiler-rt/test/asan/TestCases/debug_double_free.cpp | 4 ++--
 compiler-rt/test/asan/TestCases/debug_report.cpp      | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/compiler-rt/test/asan/TestCases/debug_double_free.cpp b/compiler-rt/test/asan/TestCases/debug_double_free.cpp
index de5ac7b0c8d5c..d7c59f8b41236 100644
--- a/compiler-rt/test/asan/TestCases/debug_double_free.cpp
+++ b/compiler-rt/test/asan/TestCases/debug_double_free.cpp
@@ -7,9 +7,9 @@
 // FIXME: Doesn't work with DLLs
 // XFAIL: win32-dynamic-asan
 
-// If we use %p with MSVC, it comes out all upper case. Use %08x to get
+// If we use %p with MS CRTs, it comes out all upper case. Use %08x to get
 // lowercase hex.
-#ifdef _MSC_VER
+#ifdef _WIN32
 # ifdef _WIN64
 #  define PTR_FMT "0x%08llx"
 # else
diff --git a/compiler-rt/test/asan/TestCases/debug_report.cpp b/compiler-rt/test/asan/TestCases/debug_report.cpp
index 617b7ee91e18d..d02ce50312226 100644
--- a/compiler-rt/test/asan/TestCases/debug_report.cpp
+++ b/compiler-rt/test/asan/TestCases/debug_report.cpp
@@ -22,9 +22,9 @@ int main() {
   return 0;
 }
 
-// If we use %p with MSVC, it comes out all upper case. Use %08x to get
+// If we use %p with MS CRTs, it comes out all upper case. Use %08x to get
 // lowercase hex.
-#ifdef _MSC_VER
+#ifdef _WIN32
 # ifdef _WIN64
 #  define PTR_FMT "0x%08llx"
 # else



More information about the llvm-commits mailing list