Skip to content

Commit c2b256a

Browse files
committed
Reapply [clang] [test] Narrow down MSVC specific behaviours from "any windows" to only MSVC/clang-cl
This fixes running tests with a toolchain that defaults to a MinGW target. After the previous attempt with this patch, this is now changed to use !defined(__MINGW32__) instead of defined(_MSC_VER) to distinguish between MSVC and MinGW mode; Clang doesn't define _MSC_VER when invoked with "clang -cc1" as some of those tests do. Differential Revision: https://reviews.llvm.org/D149997
1 parent 82f7b03 commit c2b256a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

clang/test/C/drs/dr1xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ void dr118(void) {
235235
* type at this point.
236236
*/
237237
Val = sizeof(enum E)
238-
#ifndef _WIN32
238+
#if !defined(_WIN32) || defined(__MINGW32__)
239239
/* expected-error@-2 {{invalid application of 'sizeof' to an incomplete type 'enum E'}} */
240240
/* expected-note@-12 {{definition of 'enum E' is not complete until the closing '}'}} */
241241
#endif

clang/test/Driver/experimental-library-flag.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// On some platforms, -stdlib=libc++ is currently ignored, so -lc++experimental is not added.
22
// Once -stdlib=libc++ works on those, this XFAIL can be removed.
3-
// XFAIL: target={{.*-windows.*}}, target={{.*-(ps4|ps5)}}
3+
// XFAIL: target={{.*-windows-msvc.*}}, target={{.*-(ps4|ps5)}}
44

55
// For some reason, this fails with a core dump on AIX. This needs to be investigated.
66
// UNSUPPORTED: target={{.*}}-aix{{.*}}

clang/test/SemaCXX/attr-trivial-abi.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ void __attribute__((trivial_abi)) foo(); // expected-warning {{'trivial_abi' att
55
// Should not crash.
66
template <class>
77
class __attribute__((trivial_abi)) a { a(a &&); };
8-
#ifdef _WIN64
9-
// On Windows, to be trivial-for-calls, an object must be trivially copyable.
8+
#if defined(_WIN64) && !defined(__MINGW32__)
9+
// On Windows/MSVC, to be trivial-for-calls, an object must be trivially copyable.
1010
// (And it is only trivially relocatable, currently, if it is trivial for calls.)
1111
// In this case, it is suppressed by an explicitly defined move constructor.
12-
// Similar concerns apply to later tests that have #ifdef _WIN64.
12+
// Similar concerns apply to later tests that have #if defined(_WIN64) && !defined(__MINGW32__)
1313
static_assert(!__is_trivially_relocatable(a<int>), "");
1414
#else
1515
static_assert(__is_trivially_relocatable(a<int>), "");
@@ -137,7 +137,7 @@ struct __attribute__((trivial_abi)) CopyDeleted {
137137
CopyDeleted(const CopyDeleted &) = delete;
138138
CopyDeleted(CopyDeleted &&) = default;
139139
};
140-
#ifdef _WIN64
140+
#if defined(_WIN64) && !defined(__MINGW32__)
141141
static_assert(!__is_trivially_relocatable(CopyDeleted), "");
142142
#else
143143
static_assert(__is_trivially_relocatable(CopyDeleted), "");
@@ -163,7 +163,7 @@ static_assert(!__is_trivially_relocatable(S19), "");
163163
struct __attribute__((trivial_abi)) S20 {
164164
int &&a; // a member of rvalue reference type deletes the copy constructor.
165165
};
166-
#ifdef _WIN64
166+
#if defined(_WIN64) && !defined(__MINGW32__)
167167
static_assert(!__is_trivially_relocatable(S20), "");
168168
#else
169169
static_assert(__is_trivially_relocatable(S20), "");

0 commit comments

Comments
 (0)