[compiler-rt] e70ec2e - [asan][test][win] Make report_after_syminitialize test less brittle

Alvin Wong via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 2 00:37:49 PDT 2023


Author: Alvin Wong
Date: 2023-04-02T15:37:27+08:00
New Revision: e70ec2e50f41f8dd966cbd90090b8a2dfee316e1

URL: https://github.com/llvm/llvm-project/commit/e70ec2e50f41f8dd966cbd90090b8a2dfee316e1
DIFF: https://github.com/llvm/llvm-project/commit/e70ec2e50f41f8dd966cbd90090b8a2dfee316e1.diff

LOG: [asan][test][win] Make report_after_syminitialize test less brittle

Instead of relying on one of the two commands failing on MinGW target,
just use the `%if` conditional substitution feature from lit, which is
much less brittle.

Amends 5888a47914f44ffaf102fcb7afd3500706fe753f

Differential Revision: https://reviews.llvm.org/D147382

Added: 
    

Modified: 
    compiler-rt/test/asan/TestCases/Windows/report_after_syminitialize.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/asan/TestCases/Windows/report_after_syminitialize.cpp b/compiler-rt/test/asan/TestCases/Windows/report_after_syminitialize.cpp
index 45bb6f3f5d224..10e56635ac02f 100644
--- a/compiler-rt/test/asan/TestCases/Windows/report_after_syminitialize.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/report_after_syminitialize.cpp
@@ -3,12 +3,7 @@
 // not support it, so we need to specify extra flags to get the compiler to
 // generate PDB debug info.
 
-// The first build command is intended for MSVC target, which fails on MinGW.
-// The second build command contains the flags required to get PDB debug info
-// on a MinGW build, which fails on MSVC.
-
-// RUN: %clangxx_asan -O0 %s -o %t \
-// RUN: || %clangxx_asan -gcodeview -gcolumn-info -Wl,--pdb= -O0 %s -o %t -ldbghelp
+// RUN: %clangxx_asan %if target={{.*-windows-gnu}} %{ -gcodeview -gcolumn-info -Wl,--pdb= -ldbghelp %} -O0 %s -o %t
 // RUN: %env_asan_opts=external_symbolizer_path=non-existent\\\\asdf not %run %t 2>&1 | FileCheck %s
 
 #include <windows.h>


        


More information about the llvm-commits mailing list