[asan][test][win] Make report_after_syminitialize test less brittle
authorAlvin Wong <alvin@alvinhc.com>
Sat, 1 Apr 2023 18:16:07 +0000 (02:16 +0800)
committerAlvin Wong <alvin@alvinhc.com>
Sun, 2 Apr 2023 07:37:27 +0000 (15:37 +0800)
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

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

index 45bb6f3..10e5663 100644 (file)
@@ -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>