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

+7-3
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

+1-3
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

+1-3
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

+1-3
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

+1-3
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

+1-3
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

+1-3
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

+1-3
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

+1-3
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

+1-3
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/global_const_string.cpp

+1-3
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 <windows.h>

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

+1-3
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/heapalloc_sanity.cpp

+1-3
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 2>&1 | FileCheck %s
53
#include <stdio.h>
64
#include <windows.h>

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

+1-3
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 <stdio.h>

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

+1-3
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 an illegal instruction.

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

+1-3
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_sigfpe=1 not %run %t 2>&1 | FileCheck %s
53

64
// Test the error output from dividing by zero.

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

+1-3
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 <stdio.h>

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

+1-3
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 <stdio.h>

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

+1-3
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 <stdio.h>

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

+1-3
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/malloc_right_oob.cpp

+1-3
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/malloc_uaf.cpp

+1-3
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/oom.cpp

+1-3
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
// REQUIRES: asan-32-bits
64

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

+1-3
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/operator_new_left_oob.cpp

+1-3
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/operator_new_right_oob.cpp

+1-3
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/operator_new_uaf.cpp

+1-3
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/queue_user_work_item_report.cpp

+1-3
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/realloc_left_oob.cpp

+1-3
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/realloc_right_oob.cpp

+1-3
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/realloc_uaf.cpp

+1-3
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/shadow_mapping_failure.cpp

+1-3
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
// REQUIRES: asan-32-bits
64

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

+1-3
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 <stdio.h>

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

+1-3
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 <stdio.h>

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

+1-3
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 <stdio.h>

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

+1-3
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/thread_stack_array_left_oob.cpp

+1-3
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/thread_stack_array_right_oob.cpp

+1-3
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/thread_stack_reuse.cpp

+1-3
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/thread_stress.cpp

+1-3
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/thread_suspended.cpp

+1-3
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/use_after_realloc.cpp

+1-3
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/windows_h.cpp

+1-3
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
// Just make sure we can parse <windows.h>

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

+1-3
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
class Parent {

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

+1-3
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
class Parent {

0 commit comments

Comments
 (0)