[PATCH] D147382: [asan][test][win] Make report_after_syminitialize test less brittle

Alvin Wong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 1 11:21:25 PDT 2023


alvinhochun created this revision.
alvinhochun added reviewers: mstorsjo, vitalybuka, glider, kcc.
Herald added a subscriber: Enna1.
Herald added a project: All.
alvinhochun requested review of this revision.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

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 <https://reviews.llvm.org/rG5888a47914f44ffaf102fcb7afd3500706fe753f>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147382

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


Index: compiler-rt/test/asan/TestCases/Windows/report_after_syminitialize.cpp
===================================================================
--- compiler-rt/test/asan/TestCases/Windows/report_after_syminitialize.cpp
+++ 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>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147382.510252.patch
Type: text/x-patch
Size: 991 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230401/7916116d/attachment.bin>


More information about the llvm-commits mailing list