[compiler-rt] 65abcf6 - [asan][test][win] Move MSVC-specific tests into a subdir

Alvin Wong via llvm-commits llvm-commits at lists.llvm.org
Tue May 16 04:54:31 PDT 2023


Author: Alvin Wong
Date: 2023-05-16T19:53:49+08:00
New Revision: 65abcf6c0ce1315fa0404f5cd0f6b093c038794e

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

LOG: [asan][test][win] Move MSVC-specific tests into a subdir

This moves all but one remaining tests which use clang-cl and test
MSVC-specific behaviour into its own subdirectory. `dll_host.cpp` test
is excluded from the move because other tests also depend on its source
file, making it not MSVC-specific.

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

Added: 
    compiler-rt/test/asan/TestCases/Windows/msvc/coverage-dll-stdio.cpp
    compiler-rt/test/asan/TestCases/Windows/msvc/dll_and_lib.cpp
    compiler-rt/test/asan/TestCases/Windows/msvc/dll_cerr.cpp
    compiler-rt/test/asan/TestCases/Windows/msvc/dll_control_c.cpp
    compiler-rt/test/asan/TestCases/Windows/msvc/dll_large_function.cpp
    compiler-rt/test/asan/TestCases/Windows/msvc/dll_seh.cpp
    compiler-rt/test/asan/TestCases/Windows/msvc/iostream_sbo.cpp
    compiler-rt/test/asan/TestCases/Windows/msvc/lit.local.cfg.py
    compiler-rt/test/asan/TestCases/Windows/msvc/seh.cpp
    compiler-rt/test/asan/TestCases/Windows/msvc/tls_init.cpp
    compiler-rt/test/asan/TestCases/Windows/msvc/use_after_return_linkage.cpp

Modified: 
    

Removed: 
    compiler-rt/test/asan/TestCases/Windows/coverage-dll-stdio.cpp
    compiler-rt/test/asan/TestCases/Windows/dll_and_lib.cpp
    compiler-rt/test/asan/TestCases/Windows/dll_cerr.cpp
    compiler-rt/test/asan/TestCases/Windows/dll_control_c.cpp
    compiler-rt/test/asan/TestCases/Windows/dll_large_function.cpp
    compiler-rt/test/asan/TestCases/Windows/dll_seh.cpp
    compiler-rt/test/asan/TestCases/Windows/iostream_sbo.cpp
    compiler-rt/test/asan/TestCases/Windows/seh.cpp
    compiler-rt/test/asan/TestCases/Windows/tls_init.cpp
    compiler-rt/test/asan/TestCases/Windows/use_after_return_linkage.cpp


################################################################################
diff  --git a/compiler-rt/test/asan/TestCases/Windows/coverage-dll-stdio.cpp b/compiler-rt/test/asan/TestCases/Windows/msvc/coverage-dll-stdio.cpp
similarity index 88%
rename from compiler-rt/test/asan/TestCases/Windows/coverage-dll-stdio.cpp
rename to compiler-rt/test/asan/TestCases/Windows/msvc/coverage-dll-stdio.cpp
index 2a880bae04c74..5c597c9d12f21 100644
--- a/compiler-rt/test/asan/TestCases/Windows/coverage-dll-stdio.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/msvc/coverage-dll-stdio.cpp
@@ -1,10 +1,8 @@
-// UNSUPPORTED: target={{.*-windows-gnu}}
-
 // Test that coverage and MSVC CRT stdio work from a DLL. This ensures that the
 // __local_stdio_printf_options function isn't instrumented for coverage.
 
 // RUN: rm -rf %t && mkdir %t && cd %t
-// RUN: %clang_cl_asan -fsanitize-coverage=func,trace-pc-guard -Od %p/dll_host.cpp -Fet.exe
+// RUN: %clang_cl_asan -fsanitize-coverage=func,trace-pc-guard -Od %p/../dll_host.cpp -Fet.exe
 // RUN: %clang_cl_asan -fsanitize-coverage=func,trace-pc-guard -LD -Od %s -Fet.dll
 // RUN: %run ./t.exe t.dll 2>&1 | FileCheck %s
 

diff  --git a/compiler-rt/test/asan/TestCases/Windows/dll_and_lib.cpp b/compiler-rt/test/asan/TestCases/Windows/msvc/dll_and_lib.cpp
similarity index 93%
rename from compiler-rt/test/asan/TestCases/Windows/dll_and_lib.cpp
rename to compiler-rt/test/asan/TestCases/Windows/msvc/dll_and_lib.cpp
index 0346ecfb77352..96fae6b1d6039 100644
--- a/compiler-rt/test/asan/TestCases/Windows/dll_and_lib.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/msvc/dll_and_lib.cpp
@@ -1,5 +1,3 @@
-// UNSUPPORTED: target={{.*-windows-gnu}}
-
 // Just make sure we can link an implib into another DLL
 // This used to fail between r212699 and r212814.
 // RUN: %clang_cl_asan -DCONFIG=1 %s -c -Fo%t.1.obj

diff  --git a/compiler-rt/test/asan/TestCases/Windows/dll_cerr.cpp b/compiler-rt/test/asan/TestCases/Windows/msvc/dll_cerr.cpp
similarity index 87%
rename from compiler-rt/test/asan/TestCases/Windows/dll_cerr.cpp
rename to compiler-rt/test/asan/TestCases/Windows/msvc/dll_cerr.cpp
index ff84090d046aa..2be2c627bd27c 100644
--- a/compiler-rt/test/asan/TestCases/Windows/dll_cerr.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/msvc/dll_cerr.cpp
@@ -1,6 +1,4 @@
-// UNSUPPORTED: target={{.*-windows-gnu}}
-
-// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
+// RUN: %clang_cl_asan -Od %p/../dll_host.cpp -Fe%t
 // RUN: %clang_cl_asan -LD -Od %s -Fe%t.dll
 // RUN: %run %t %t.dll 2>&1 | FileCheck %s
 

diff  --git a/compiler-rt/test/asan/TestCases/Windows/dll_control_c.cpp b/compiler-rt/test/asan/TestCases/Windows/msvc/dll_control_c.cpp
similarity index 97%
rename from compiler-rt/test/asan/TestCases/Windows/dll_control_c.cpp
rename to compiler-rt/test/asan/TestCases/Windows/msvc/dll_control_c.cpp
index f5127e75d3ff8..0faa2ffbc2fef 100644
--- a/compiler-rt/test/asan/TestCases/Windows/dll_control_c.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/msvc/dll_control_c.cpp
@@ -1,6 +1,4 @@
-// UNSUPPORTED: target={{.*-windows-gnu}}
-
-// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
+// RUN: %clang_cl_asan -Od %p/../dll_host.cpp -Fe%t
 // RUN: %clang_cl_asan -LD -O2 %s -Fe%t.dll
 // RUNX: %run %t %t.dll 2>&1 | FileCheck %s
 

diff  --git a/compiler-rt/test/asan/TestCases/Windows/dll_large_function.cpp b/compiler-rt/test/asan/TestCases/Windows/msvc/dll_large_function.cpp
similarity index 92%
rename from compiler-rt/test/asan/TestCases/Windows/dll_large_function.cpp
rename to compiler-rt/test/asan/TestCases/Windows/msvc/dll_large_function.cpp
index c047a5292f94b..788488dbb8ed8 100644
--- a/compiler-rt/test/asan/TestCases/Windows/dll_large_function.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/msvc/dll_large_function.cpp
@@ -1,5 +1,3 @@
-// UNSUPPORTED: target={{.*-windows-gnu}}
-
 // Make sure we can link a DLL with large functions which would mean
 // functions such as __asan_loadN and __asan_storeN will be called
 // from the DLL.  We simulate the large function with

diff  --git a/compiler-rt/test/asan/TestCases/Windows/dll_seh.cpp b/compiler-rt/test/asan/TestCases/Windows/msvc/dll_seh.cpp
similarity index 93%
rename from compiler-rt/test/asan/TestCases/Windows/dll_seh.cpp
rename to compiler-rt/test/asan/TestCases/Windows/msvc/dll_seh.cpp
index 009351dd72276..9a29bee75c1b5 100644
--- a/compiler-rt/test/asan/TestCases/Windows/dll_seh.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/msvc/dll_seh.cpp
@@ -1,6 +1,4 @@
-// UNSUPPORTED: target={{.*-windows-gnu}}
-
-// RUN: %clang_cl_asan -Od %p/dll_host.cpp -Fe%t
+// RUN: %clang_cl_asan -Od %p/../dll_host.cpp -Fe%t
 //
 // Check both -GS and -GS- builds:
 // RUN: %clang_cl_asan -GS  -LD -Od %s -Fe%t.dll

diff  --git a/compiler-rt/test/asan/TestCases/Windows/iostream_sbo.cpp b/compiler-rt/test/asan/TestCases/Windows/msvc/iostream_sbo.cpp
similarity index 76%
rename from compiler-rt/test/asan/TestCases/Windows/iostream_sbo.cpp
rename to compiler-rt/test/asan/TestCases/Windows/msvc/iostream_sbo.cpp
index eea38b82e015d..3d4158f8c331e 100644
--- a/compiler-rt/test/asan/TestCases/Windows/iostream_sbo.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/msvc/iostream_sbo.cpp
@@ -1,11 +1,9 @@
-// UNSUPPORTED: target={{.*-windows-gnu}}
-
 // First, check this works with the default ignorelist:
 // RUN: %clang_cl_asan -Od %s -Fe%t
 // RUN: echo "42" | %run %t 2>&1 | FileCheck %s
 //
 // Then, make sure it still works when a user uses their own ignorelist file:
-// RUN: %clang_cl_asan -Od %s -fsanitize-ignorelist=%p/../Helpers/initialization-ignorelist.txt -Fe%t2
+// RUN: %clang_cl_asan -Od %s -fsanitize-ignorelist=%p/../../Helpers/initialization-ignorelist.txt -Fe%t2
 // RUN: echo "42" | %run %t2 2>&1 | FileCheck %s
 
 #include <iostream>

diff  --git a/compiler-rt/test/asan/TestCases/Windows/msvc/lit.local.cfg.py b/compiler-rt/test/asan/TestCases/Windows/msvc/lit.local.cfg.py
new file mode 100644
index 0000000000000..91979845cb23f
--- /dev/null
+++ b/compiler-rt/test/asan/TestCases/Windows/msvc/lit.local.cfg.py
@@ -0,0 +1,4 @@
+import re
+
+if not re.match(r'.*-windows-msvc$', config.target_triple):
+    config.unsupported = True

diff  --git a/compiler-rt/test/asan/TestCases/Windows/seh.cpp b/compiler-rt/test/asan/TestCases/Windows/msvc/seh.cpp
similarity index 97%
rename from compiler-rt/test/asan/TestCases/Windows/seh.cpp
rename to compiler-rt/test/asan/TestCases/Windows/msvc/seh.cpp
index a6cb048a07a63..4cb0c55bc7730 100644
--- a/compiler-rt/test/asan/TestCases/Windows/seh.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/msvc/seh.cpp
@@ -1,5 +1,3 @@
-// UNSUPPORTED: target={{.*-windows-gnu}}
-
 // Make sure that ASan works with SEH in both Clang and MSVC. MSVC uses a
 // 
diff erent EH personality depending on the -GS setting, so test both -GS+ and
 // -GS-.

diff  --git a/compiler-rt/test/asan/TestCases/Windows/tls_init.cpp b/compiler-rt/test/asan/TestCases/Windows/msvc/tls_init.cpp
similarity index 96%
rename from compiler-rt/test/asan/TestCases/Windows/tls_init.cpp
rename to compiler-rt/test/asan/TestCases/Windows/msvc/tls_init.cpp
index 5cf0768a7fa4f..a8569f8025c84 100644
--- a/compiler-rt/test/asan/TestCases/Windows/tls_init.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/msvc/tls_init.cpp
@@ -1,5 +1,3 @@
-// UNSUPPORTED: target={{.*-windows-gnu}}
-
 // RUN: %clang_cl_asan %s -Fe%t.exe /MD
 // RUN: %run %t.exe | FileCheck %s
 

diff  --git a/compiler-rt/test/asan/TestCases/Windows/use_after_return_linkage.cpp b/compiler-rt/test/asan/TestCases/Windows/msvc/use_after_return_linkage.cpp
similarity index 87%
rename from compiler-rt/test/asan/TestCases/Windows/use_after_return_linkage.cpp
rename to compiler-rt/test/asan/TestCases/Windows/msvc/use_after_return_linkage.cpp
index 8f92a149fe0a6..cacf461b4f33a 100644
--- a/compiler-rt/test/asan/TestCases/Windows/use_after_return_linkage.cpp
+++ b/compiler-rt/test/asan/TestCases/Windows/msvc/use_after_return_linkage.cpp
@@ -1,5 +1,3 @@
-// UNSUPPORTED: target={{.*-windows-gnu}}
-
 // Make sure LIBCMT doesn't accidentally get added to the list of DEFAULTLIB
 // directives.
 


        


More information about the llvm-commits mailing list