Skip to content

Commit 3c1aa20

Browse files
committed
[asan][test][win] Port trivial tests to not use clang-cl on MinGW
Use clang driver on MinGW where clang-cl is not usable. MSVC target still uses clang-cl to minimize changes to existing test runners. Differential Revision: https://reviews.llvm.org/D147432
1 parent 2b81ec3 commit 3c1aa20

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+83
-157
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
// UNSUPPORTED: target={{.*-windows-gnu}}
2-
3-
// RUN: %clang_cl_asan -Od %s -Fe%t
1+
// RUN: %clang_cl_asan %Od %s %Fe%t
42
// RUN: %run %t
53

64
#include <windows.h>
75

6+
#ifdef __MINGW32__
7+
// FIXME: remove after mingw-w64 adds this declaration.
8+
extern "C" size_t __cdecl _aligned_msize(void *_Memory, size_t _Alignment,
9+
size_t _Offset);
10+
#endif
11+
812
#define CHECK_ALIGNED(ptr,alignment) \
913
do { \
1014
if (((uintptr_t)(ptr) % (alignment)) != 0) \

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// UNSUPPORTED: target={{.*-windows-gnu}}
2-
3-
// RUN: %clang_cl_asan -Od %s -Fe%t
1+
// RUN: %clang_cl_asan %Od %s %Fe%t
42
// RUN: %run %t | FileCheck %s
53

64
#include <malloc.h>

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// UNSUPPORTED: target={{.*-windows-gnu}}
2-
3-
// RUN: %clang_cl_asan -Od %s -Fe%t
1+
// RUN: %clang_cl_asan %Od %s %Fe%t
42
// RUN: %run %t
53

64
#include <windows.h>

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// UNSUPPORTED: target={{.*-windows-gnu}}
2-
3-
// RUN: %clang_cl_asan -Od %s -Fe%t
1+
// RUN: %clang_cl_asan %Od %s %Fe%t
42
// RUN: %run %t
53

64
#include <windows.h>

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// UNSUPPORTED: target={{.*-windows-gnu}}
2-
3-
// RUN: %clang_cl_asan -Od %s -Fe%t
1+
// RUN: %clang_cl_asan %Od %s %Fe%t
42
// RUN: not %run %t 2>&1 | FileCheck %s
53

64
#include <windows.h>

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// UNSUPPORTED: target={{.*-windows-gnu}}
2-
3-
// RUN: %clang_cl_asan -Od %s -Fe%t
1+
// RUN: %clang_cl_asan %Od %s %Fe%t
42
// RUN: %env_asan_opts=handle_sigill=1 not %run %t 2>&1 | FileCheck %s
53

64
// Test the error output from a breakpoint. Assertion-like macros often end in

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// UNSUPPORTED: target={{.*-windows-gnu}}
2-
3-
// RUN: %clang_cl_asan -Od %s -Fe%t
1+
// RUN: %clang_cl_asan %Od %s %Fe%t
42
// RUN: not %run %t 2>&1 | FileCheck %s
53

64
#include <malloc.h>

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// UNSUPPORTED: target={{.*-windows-gnu}}
2-
3-
// RUN: %clang_cl_asan -Od %s -Fe%t
1+
// RUN: %clang_cl_asan %Od %s %Fe%t
42
// RUN: not %run %t 2>&1 | FileCheck %s
53

64
#include <malloc.h>

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// UNSUPPORTED: target={{.*-windows-gnu}}
2-
3-
// RUN: %clang_cl_asan -Od %s -Fe%t
1+
// RUN: %clang_cl_asan %Od %s %Fe%t
42
// RUN: not %run %t 2>&1 | FileCheck %s
53

64
#include <malloc.h>

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// UNSUPPORTED: target={{.*-windows-gnu}}
2-
3-
// RUN: %clang_cl_asan -Od %s -Fe%t
1+
// RUN: %clang_cl_asan %Od %s %Fe%t
42
// RUN: not %run %t 2>&1 | FileCheck %s
53

64
#include <malloc.h>

0 commit comments

Comments
 (0)