[libcxx-commits] [libcxx] 4e00a19 - [libcxx][test] compiler options are non-portable

Casey Carter via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 18 11:35:08 PST 2022


Author: Casey Carter
Date: 2022-01-18T11:34:57-08:00
New Revision: 4e00a1921fb15898fd1680308ae603919aea8811

URL: https://github.com/llvm/llvm-project/commit/4e00a1921fb15898fd1680308ae603919aea8811
DIFF: https://github.com/llvm/llvm-project/commit/4e00a1921fb15898fd1680308ae603919aea8811.diff

LOG: [libcxx][test] compiler options are non-portable

... it's easier to suppress warnings internally, where we can detect the compiler.

* Rename `TEST_COMPILER_C1XX` to `TEST_COMPILER_MSVC`
* Rename all `TEST_WORKAROUND_C1XX_<meow>` to `TEST_WORKAROUND_MSVC_<meow>`

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

Added: 
    

Modified: 
    libcxx/include/__support/win32/limits_msvc_win32.h
    libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
    libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
    libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp
    libcxx/test/std/library/description/conventions/expos.only.func/synth_three_way.pass.cpp
    libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
    libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/ctor.value.bound.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/end.pass.cpp
    libcxx/test/std/ranges/range.factories/range.iota.view/iterator/star.pass.cpp
    libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
    libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.pass.cpp
    libcxx/test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp
    libcxx/test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
    libcxx/test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp
    libcxx/test/std/utilities/tuple/tuple.tuple/tuple.rel/three_way.pass.cpp
    libcxx/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp
    libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
    libcxx/test/support/archetypes.h
    libcxx/test/support/charconv_test_helpers.h
    libcxx/test/support/count_new.h
    libcxx/test/support/test.workarounds/c1xx_broken_is_trivially_copyable.pass.cpp
    libcxx/test/support/test.workarounds/c1xx_broken_za_ctor_check.pass.cpp
    libcxx/test/support/test_macros.h
    libcxx/test/support/test_workarounds.h

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__support/win32/limits_msvc_win32.h b/libcxx/include/__support/win32/limits_msvc_win32.h
index c80df6693ce2f..87e4e7db668f7 100644
--- a/libcxx/include/__support/win32/limits_msvc_win32.h
+++ b/libcxx/include/__support/win32/limits_msvc_win32.h
@@ -14,7 +14,7 @@
 #error "This header complements the Microsoft C Runtime library, and should not be included otherwise."
 #endif
 #if defined(__clang__)
-#error "This header should only be included when using Microsofts C1XX frontend"
+#error "This header should only be included when using Microsoft's C1XX frontend"
 #endif
 
 #include <float.h> // limit constants

diff  --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
index 82df626065fe4..6ee26124be357 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
@@ -16,7 +16,7 @@
 
 #include "test_macros.h"
 
-#ifdef TEST_COMPILER_C1XX
+#ifdef TEST_COMPILER_MSVC
 #pragma warning(disable: 4244) // conversion from 'const double' to 'int', possible loss of data
 #endif
 

diff  --git a/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
index bac1fc116c2da..347ce3e68dbd4 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
@@ -165,14 +165,14 @@ void test_ctor_with_
diff erent_value_type() {
     // Make sure initialization is performed with each element value, not with
     // a memory blob.
     float array[3] = {0.0f, 1.0f, 2.0f};
-#ifdef TEST_COMPILER_C1XX
+#ifdef TEST_COMPILER_MSVC
     #pragma warning(push)
     #pragma warning(disable: 4244) // conversion from 'float' to 'int', possible loss of data
-#endif // TEST_COMPILER_C1XX
+#endif // TEST_COMPILER_MSVC
     std::vector<int> v(array, array + 3);
-#ifdef TEST_COMPILER_C1XX
+#ifdef TEST_COMPILER_MSVC
     #pragma warning(pop)
-#endif // TEST_COMPILER_C1XX
+#endif // TEST_COMPILER_MSVC
     assert(v[0] == 0);
     assert(v[1] == 1);
     assert(v[2] == 2);

diff  --git a/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp b/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp
index fe140c38c7b05..143ccc513c493 100644
--- a/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp
+++ b/libcxx/test/std/iterators/stream.iterators/ostream.iterator/ostream.iterator.ops/assign_t.pass.cpp
@@ -22,7 +22,7 @@
 #pragma clang diagnostic ignored "-Wliteral-conversion"
 #endif
 
-#ifdef TEST_COMPILER_C1XX
+#ifdef TEST_COMPILER_MSVC
 #pragma warning(disable: 4244) // conversion from 'X' to 'Y', possible loss of data
 #endif
 

diff  --git a/libcxx/test/std/library/description/conventions/expos.only.func/synth_three_way.pass.cpp b/libcxx/test/std/library/description/conventions/expos.only.func/synth_three_way.pass.cpp
index 8fbe321eadd50..e4ba1f7f0ad72 100644
--- a/libcxx/test/std/library/description/conventions/expos.only.func/synth_three_way.pass.cpp
+++ b/libcxx/test/std/library/description/conventions/expos.only.func/synth_three_way.pass.cpp
@@ -7,19 +7,24 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17, libcpp-no-concepts
-// ADDITIONAL_COMPILE_FLAGS: -Wno-sign-compare
 
 // constexpr auto synth-three-way = ...;
 //   via std::tuple<T>(t) <=> std::tuple<U>(u), which exposes its behavior most directly
 
+#include "test_macros.h"
+
+#if defined(TEST_COMPILER_CLANG) || defined(TEST_COMPILER_GCC)
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#elif defined(TEST_COMPILER_MSVC)
+#pragma warning(disable: 4242 4244) // Various truncation warnings
+#endif
+
 #include <cassert>
 #include <compare>
 #include <limits>  // quiet_NaN
 #include <tuple>
 #include <utility> // declval
 
-#include "test_macros.h"
-
 template <typename T, typename U = T>
 concept can_synth_three_way = requires(T t, U u) { std::tuple<T>(t) <=> std::tuple<U>(u); };
 

diff  --git a/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp b/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
index ecfe08c3d9fbd..f69e579cd2b1b 100644
--- a/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
@@ -22,7 +22,7 @@
 #include "test_iterators.h"
 #include "test_macros.h"
 
-#ifdef TEST_COMPILER_C1XX
+#ifdef TEST_COMPILER_MSVC
 #pragma warning(disable: 4146) // unary minus operator applied to unsigned type, result still unsigned
 #endif
 

diff  --git a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp
index a8c86bad30679..142ea437ddd7d 100644
--- a/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp
+++ b/libcxx/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp
@@ -44,10 +44,10 @@ test1()
     assert((LCE::min() == (c == 0u ? 1u: 0u)));
 #endif
 
-#ifdef TEST_COMPILER_C1XX
+#ifdef TEST_COMPILER_MSVC
     #pragma warning(push)
     #pragma warning(disable: 4310) // cast truncates constant value
-#endif // TEST_COMPILER_C1XX
+#endif // TEST_COMPILER_MSVC
 
 #if TEST_STD_VER >= 11
     static_assert((LCE::max() == result_type(m - 1u)), "");
@@ -55,9 +55,9 @@ test1()
     assert((LCE::max() == result_type(m - 1u)));
 #endif
 
-#ifdef TEST_COMPILER_C1XX
+#ifdef TEST_COMPILER_MSVC
     #pragma warning(pop)
-#endif // TEST_COMPILER_C1XX
+#endif // TEST_COMPILER_MSVC
 
     static_assert((LCE::default_seed == 1), "");
     where(LCE::multiplier);

diff  --git a/libcxx/test/std/ranges/range.factories/range.iota.view/ctor.value.bound.pass.cpp b/libcxx/test/std/ranges/range.factories/range.iota.view/ctor.value.bound.pass.cpp
index 21f5558f61d81..1214dca843b06 100644
--- a/libcxx/test/std/ranges/range.factories/range.iota.view/ctor.value.bound.pass.cpp
+++ b/libcxx/test/std/ranges/range.factories/range.iota.view/ctor.value.bound.pass.cpp
@@ -10,14 +10,19 @@
 // UNSUPPORTED: libcpp-no-concepts
 // UNSUPPORTED: libcpp-has-no-incomplete-ranges
 
-// ADDITIONAL_COMPILE_FLAGS: -Wno-sign-compare
+#include "test_macros.h"
+
+#if defined(TEST_COMPILER_CLANG) || defined(TEST_COMPILER_GCC)
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#elif defined(TEST_COMPILER_MSVC)
+#pragma warning(disable: 4018 4389) // various "signed/unsigned mismatch"
+#endif
 
 // constexpr iota_view(type_identity_t<W> value, type_identity_t<Bound> bound);
 
 #include <ranges>
 #include <cassert>
 
-#include "test_macros.h"
 #include "types.h"
 
 constexpr bool test() {
@@ -57,4 +62,3 @@ int main(int, char**) {
 
   return 0;
 }
-

diff  --git a/libcxx/test/std/ranges/range.factories/range.iota.view/end.pass.cpp b/libcxx/test/std/ranges/range.factories/range.iota.view/end.pass.cpp
index 418a52a3b9d2f..dfbc588b2e0cd 100644
--- a/libcxx/test/std/ranges/range.factories/range.iota.view/end.pass.cpp
+++ b/libcxx/test/std/ranges/range.factories/range.iota.view/end.pass.cpp
@@ -10,7 +10,13 @@
 // UNSUPPORTED: libcpp-no-concepts
 // UNSUPPORTED: libcpp-has-no-incomplete-ranges
 
-// ADDITIONAL_COMPILE_FLAGS: -Wno-sign-compare
+#include "test_macros.h"
+
+#if defined(TEST_COMPILER_CLANG) || defined(TEST_COMPILER_GCC)
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#elif defined(TEST_COMPILER_MSVC)
+#pragma warning(disable: 4018 4389) // various "signed/unsigned mismatch"
+#endif
 
 // constexpr auto end() const;
 // constexpr iterator end() const requires same_as<W, Bound>;
@@ -18,7 +24,6 @@
 #include <ranges>
 #include <cassert>
 
-#include "test_macros.h"
 #include "types.h"
 
 template<class T, class U>

diff  --git a/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/star.pass.cpp b/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/star.pass.cpp
index 492d7333fa9a0..fae25fce0184a 100644
--- a/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/star.pass.cpp
+++ b/libcxx/test/std/ranges/range.factories/range.iota.view/iterator/star.pass.cpp
@@ -10,14 +10,19 @@
 // UNSUPPORTED: libcpp-no-concepts
 // UNSUPPORTED: libcpp-has-no-incomplete-ranges
 
-// ADDITIONAL_COMPILE_FLAGS: -Wno-sign-compare
-
 // constexpr W operator*() const noexcept(is_nothrow_copy_constructible_v<W>);
 
+#include "test_macros.h"
+
+#if defined(TEST_COMPILER_CLANG) || defined(TEST_COMPILER_GCC)
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#elif defined(TEST_COMPILER_MSVC)
+#pragma warning(disable: 4018) // various "signed/unsigned mismatch"
+#endif
+
 #include <ranges>
 #include <cassert>
 
-#include "test_macros.h"
 #include "../types.h"
 
 struct NotNoexceptCopy {

diff  --git a/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp b/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
index f9b7e439cc3e9..08fb15927aea8 100644
--- a/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
@@ -245,7 +245,7 @@ void throws_in_constructor_test()
       ThrowsOnCopy() = default;
       bool operator()() const {
         assert(false);
-#if defined(TEST_COMPILER_C1XX)
+#ifdef TEST_COMPILER_MSVC
         __assume(0);
 #else
         __builtin_unreachable();

diff  --git a/libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.pass.cpp b/libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.pass.cpp
index b96ce8dd4bd51..e7453c81cf77e 100644
--- a/libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.pass.cpp
@@ -34,10 +34,10 @@ template <bool> struct InTemplate {};
 int main(int, char**)
 {
 #ifdef __cpp_lib_is_constant_evaluated
-#ifdef TEST_COMPILER_C1XX
+#ifdef TEST_COMPILER_MSVC
     #pragma warning(push)
     #pragma warning(disable: 5063) // 'std::is_constant_evaluated' always evaluates to true in manifestly constant-evaluated expressions
-#endif // TEST_COMPILER_C1XX
+#endif // TEST_COMPILER_MSVC
   // Test the signature
   {
     ASSERT_SAME_TYPE(decltype(std::is_constant_evaluated()), bool);
@@ -55,9 +55,9 @@ int main(int, char**)
     static int local_static = std::is_constant_evaluated() ? 42 : -1;
     assert(local_static == 42);
   }
-#ifdef TEST_COMPILER_C1XX
+#ifdef TEST_COMPILER_MSVC
     #pragma warning(pop)
-#endif // TEST_COMPILER_C1XX
+#endif // TEST_COMPILER_MSVC
 #endif // __cpp_lib_is_constant_evaluated
   return 0;
 }

diff  --git a/libcxx/test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp b/libcxx/test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp
index 58549b94e0d38..d9b2dbf8a017a 100644
--- a/libcxx/test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp
+++ b/libcxx/test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp
@@ -18,7 +18,7 @@
 
 #include "test_macros.h"
 
-#if defined(TEST_COMPILER_C1XX)
+#ifdef TEST_COMPILER_MSVC
 #pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 

diff  --git a/libcxx/test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp b/libcxx/test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
index 2f5c066221da6..6526be4e16bc2 100644
--- a/libcxx/test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
+++ b/libcxx/test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
@@ -15,7 +15,7 @@
 
 #include "test_macros.h"
 
-#if defined(TEST_COMPILER_C1XX)
+#ifdef TEST_COMPILER_MSVC
 #pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 

diff  --git a/libcxx/test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp b/libcxx/test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp
index 05a78f9675928..b2fbd82793b3a 100644
--- a/libcxx/test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp
+++ b/libcxx/test/std/utilities/template.bitset/bitset.members/reset_one.pass.cpp
@@ -16,7 +16,7 @@
 #include "../bitset_test_cases.h"
 #include "test_macros.h"
 
-#if defined(TEST_COMPILER_C1XX)
+#ifdef TEST_COMPILER_MSVC
 #pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 

diff  --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.rel/three_way.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.rel/three_way.pass.cpp
index 4cd64807201b3..9bdb50aa9b296 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.rel/three_way.pass.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.rel/three_way.pass.cpp
@@ -15,7 +15,14 @@
 //   operator<=>(const tuple<TTypes...>& t, const tuple<UTypes...>& u);
 
 // UNSUPPORTED: c++03, c++11, c++14, c++17, libcpp-no-concepts
-// ADDITIONAL_COMPILE_FLAGS: -Wno-sign-compare
+
+#include "test_macros.h"
+
+#if defined(TEST_COMPILER_CLANG) || defined(TEST_COMPILER_GCC)
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#elif defined(TEST_COMPILER_MSVC)
+#pragma warning(disable: 4242 4244) // Various truncation warnings
+#endif
 
 #include <cassert>
 #include <compare>
@@ -23,8 +30,6 @@
 #include <tuple>
 #include <type_traits> // std::is_constant_evaluated
 
-#include "test_macros.h"
-
 // A custom three-way result type
 struct CustomEquality {
   friend constexpr bool operator==(const CustomEquality&, int) noexcept { return true; }

diff  --git a/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp
index 2b670bc02eeed..3fdfcbb07f3b0 100644
--- a/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp
@@ -239,15 +239,15 @@ void test_constexpr_copy_ctor() {
   // Make sure we properly propagate triviality, which implies constexpr-ness (see P0602R4).
 #if TEST_STD_VER > 17
   using V = std::variant<long, void*, const int>;
-#ifdef TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE
+#ifdef TEST_WORKAROUND_MSVC_BROKEN_IS_TRIVIALLY_COPYABLE
   static_assert(std::is_trivially_destructible<V>::value, "");
   static_assert(std::is_trivially_copy_constructible<V>::value, "");
   static_assert(std::is_trivially_move_constructible<V>::value, "");
   static_assert(!std::is_copy_assignable<V>::value, "");
   static_assert(!std::is_move_assignable<V>::value, "");
-#else // TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE
+#else // TEST_WORKAROUND_MSVC_BROKEN_IS_TRIVIALLY_COPYABLE
   static_assert(std::is_trivially_copyable<V>::value, "");
-#endif // TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE
+#endif // TEST_WORKAROUND_MSVC_BROKEN_IS_TRIVIALLY_COPYABLE
   static_assert(test_constexpr_copy_ctor_imp<0>(V(42l)), "");
   static_assert(test_constexpr_copy_ctor_imp<1>(V(nullptr)), "");
   static_assert(test_constexpr_copy_ctor_imp<2>(V(101)), "");

diff  --git a/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp b/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
index ca93d45aa9406..7d2ce7c50d904 100644
--- a/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
+++ b/libcxx/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
@@ -309,15 +309,15 @@ void test_constexpr_move_ctor() {
   // Make sure we properly propagate triviality, which implies constexpr-ness (see P0602R4).
 #if TEST_STD_VER > 17
   using V = std::variant<long, void*, const int>;
-#ifdef TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE
+#ifdef TEST_WORKAROUND_MSVC_BROKEN_IS_TRIVIALLY_COPYABLE
   static_assert(std::is_trivially_destructible<V>::value, "");
   static_assert(std::is_trivially_copy_constructible<V>::value, "");
   static_assert(std::is_trivially_move_constructible<V>::value, "");
   static_assert(!std::is_copy_assignable<V>::value, "");
   static_assert(!std::is_move_assignable<V>::value, "");
-#else // TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE
+#else // TEST_WORKAROUND_MSVC_BROKEN_IS_TRIVIALLY_COPYABLE
   static_assert(std::is_trivially_copyable<V>::value, "");
-#endif // TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE
+#endif // TEST_WORKAROUND_MSVC_BROKEN_IS_TRIVIALLY_COPYABLE
   static_assert(std::is_trivially_move_constructible<V>::value, "");
   static_assert(test_constexpr_ctor_imp<0>(V(42l)), "");
   static_assert(test_constexpr_ctor_imp<1>(V(nullptr)), "");

diff  --git a/libcxx/test/support/archetypes.h b/libcxx/test/support/archetypes.h
index bf79c53b4962f..073f395829109 100644
--- a/libcxx/test/support/archetypes.h
+++ b/libcxx/test/support/archetypes.h
@@ -23,9 +23,9 @@ template <bool, class T>
 struct DepType : T {};
 
 struct NullBase {
-#ifndef TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK
+#ifndef TEST_WORKAROUND_MSVC_BROKEN_ZA_CTOR_CHECK
 protected:
-#endif // !TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK
+#endif // !TEST_WORKAROUND_MSVC_BROKEN_ZA_CTOR_CHECK
   NullBase() = default;
   NullBase(NullBase const&) = default;
   NullBase& operator=(NullBase const&) = default;
@@ -92,9 +92,9 @@ struct TestBase {
       ++assigned; ++value_assigned;
       return *this;
     }
-#ifndef TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK
+#ifndef TEST_WORKAROUND_MSVC_BROKEN_ZA_CTOR_CHECK
 protected:
-#endif // !TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK
+#endif // !TEST_WORKAROUND_MSVC_BROKEN_ZA_CTOR_CHECK
     ~TestBase() {
       assert(value != -999); assert(alive > 0);
       --alive; ++destroyed; value = -999;
@@ -157,9 +157,9 @@ struct ValueBase {
     }
     //~ValueBase() { assert(value != -999); value = -999; }
     int value;
-#ifndef TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK
+#ifndef TEST_WORKAROUND_MSVC_BROKEN_ZA_CTOR_CHECK
 protected:
-#endif // !TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK
+#endif // !TEST_WORKAROUND_MSVC_BROKEN_ZA_CTOR_CHECK
     constexpr static int check_value(int const& val) {
 #if TEST_STD_VER < 14
       return val == -1 || val == 999 ? (TEST_THROW(42), 0) : val;
@@ -212,9 +212,9 @@ struct TrivialValueBase {
     template <bool Dummy = true, typename std::enable_if<Dummy && !Explicit, bool>::type = true>
     constexpr TrivialValueBase(std::initializer_list<int>& il, int = 0) : value(static_cast<int>(il.size())) {}
     int value;
-#ifndef TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK
+#ifndef TEST_WORKAROUND_MSVC_BROKEN_ZA_CTOR_CHECK
 protected:
-#endif // !TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK
+#endif // !TEST_WORKAROUND_MSVC_BROKEN_ZA_CTOR_CHECK
     constexpr TrivialValueBase() noexcept : value(0) {}
 };
 

diff  --git a/libcxx/test/support/charconv_test_helpers.h b/libcxx/test/support/charconv_test_helpers.h
index 006e9021145c1..fe0e68bf7f83a 100644
--- a/libcxx/test/support/charconv_test_helpers.h
+++ b/libcxx/test/support/charconv_test_helpers.h
@@ -180,10 +180,10 @@ struct roundtrip_test_base
 
             r2 = from_chars(buf, r.ptr, x, args...);
 
-#ifdef TEST_COMPILER_C1XX
+#ifdef TEST_COMPILER_MSVC
     #pragma warning(push)
     #pragma warning(disable: 4127) // conditional expression is constant
-#endif // TEST_COMPILER_C1XX
+#endif // TEST_COMPILER_MSVC
             if (std::is_signed<T>::value && v < 0 && std::is_unsigned<X>::value)
             {
                 assert(x == 0xc);
@@ -196,9 +196,9 @@ struct roundtrip_test_base
                 assert(r2.ptr == r.ptr);
                 assert(r2.ec == std::errc::result_out_of_range);
             }
-#ifdef TEST_COMPILER_C1XX
+#ifdef TEST_COMPILER_MSVC
     #pragma warning(pop)
-#endif // TEST_COMPILER_C1XX
+#endif // TEST_COMPILER_MSVC
         }
     }
 

diff  --git a/libcxx/test/support/count_new.h b/libcxx/test/support/count_new.h
index ed7bd50be209a..2d0f3f686fea9 100644
--- a/libcxx/test/support/count_new.h
+++ b/libcxx/test/support/count_new.h
@@ -347,15 +347,15 @@ class MemCounter
   const bool MemCounter::disable_checking = false;
 #endif
 
-#ifdef _MSC_VER
+#ifdef TEST_COMPILER_MSVC
 #pragma warning(push)
 #pragma warning(disable: 4640) // '%s' construction of local static object is not thread safe (/Zc:threadSafeInit-)
-#endif // _MSC_VER
+#endif // TEST_COMPILER_MSVC
 inline MemCounter* getGlobalMemCounter() {
   static MemCounter counter((MemCounter::MemCounterCtorArg_()));
   return &counter;
 }
-#ifdef _MSC_VER
+#ifdef TEST_COMPILER_MSVC
 #pragma warning(pop)
 #endif
 

diff  --git a/libcxx/test/support/test.workarounds/c1xx_broken_is_trivially_copyable.pass.cpp b/libcxx/test/support/test.workarounds/c1xx_broken_is_trivially_copyable.pass.cpp
index 8182511ed57ea..ec85bdce27db6 100644
--- a/libcxx/test/support/test.workarounds/c1xx_broken_is_trivially_copyable.pass.cpp
+++ b/libcxx/test/support/test.workarounds/c1xx_broken_is_trivially_copyable.pass.cpp
@@ -8,7 +8,7 @@
 
 // UNSUPPORTED: c++03
 
-// Verify TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE.
+// Verify TEST_WORKAROUND_MSVC_BROKEN_IS_TRIVIALLY_COPYABLE.
 
 #include <type_traits>
 
@@ -23,7 +23,7 @@ struct S {
 };
 
 int main(int, char**) {
-#if defined(TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE)
+#ifdef TEST_WORKAROUND_MSVC_BROKEN_IS_TRIVIALLY_COPYABLE
   static_assert(!std::is_trivially_copyable<S>::value, "");
 #else
   static_assert(std::is_trivially_copyable<S>::value, "");

diff  --git a/libcxx/test/support/test.workarounds/c1xx_broken_za_ctor_check.pass.cpp b/libcxx/test/support/test.workarounds/c1xx_broken_za_ctor_check.pass.cpp
index 4d25d4f9bccc7..4eb1677e71e63 100644
--- a/libcxx/test/support/test.workarounds/c1xx_broken_za_ctor_check.pass.cpp
+++ b/libcxx/test/support/test.workarounds/c1xx_broken_za_ctor_check.pass.cpp
@@ -8,7 +8,7 @@
 
 // UNSUPPORTED: c++03
 
-// Verify TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK.
+// Verify TEST_WORKAROUND_MSVC_BROKEN_ZA_CTOR_CHECK.
 
 #include <type_traits>
 
@@ -33,7 +33,7 @@ auto test(int) -> decltype(PushFront(std::declval<T>()), std::true_type{});
 auto test(long) -> std::false_type;
 
 int main(int, char**) {
-#if defined(TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK)
+#ifdef TEST_WORKAROUND_MSVC_BROKEN_ZA_CTOR_CHECK
     static_assert(!decltype(test(0))::value, "");
 #else
     static_assert(decltype(test(0))::value, "");

diff  --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h
index 29b990db9479c..32304e329421a 100644
--- a/libcxx/test/support/test_macros.h
+++ b/libcxx/test/support/test_macros.h
@@ -77,7 +77,7 @@
 #  define TEST_COMPILER_APPLE_CLANG
 # endif
 #elif defined(_MSC_VER)
-# define TEST_COMPILER_C1XX
+# define TEST_COMPILER_MSVC
 #elif defined(__GNUC__)
 # define TEST_COMPILER_GCC
 #endif

diff  --git a/libcxx/test/support/test_workarounds.h b/libcxx/test/support/test_workarounds.h
index 4909421da5c79..8417dca9834e6 100644
--- a/libcxx/test/support/test_workarounds.h
+++ b/libcxx/test/support/test_workarounds.h
@@ -16,12 +16,12 @@
 # define TEST_WORKAROUND_EDG_EXPLICIT_CONSTEXPR // VSO-424280
 #endif
 
-#if defined(TEST_COMPILER_C1XX)
+#ifdef TEST_COMPILER_MSVC
 # if _MSC_VER < 1927
-#  define TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE // VSO-117743
+#  define TEST_WORKAROUND_MSVC_BROKEN_IS_TRIVIALLY_COPYABLE // VSO-117743
 # endif
 # ifndef _MSC_EXTENSIONS
-#  define TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK // VSO-119998
+#  define TEST_WORKAROUND_MSVC_BROKEN_ZA_CTOR_CHECK // VSO-119998
 # endif
 #endif
 


        


More information about the libcxx-commits mailing list