Disable trivial pair copy/move tests when unsupported
authorDimitry Andric <dimitry@andric.com>
Wed, 12 Oct 2016 20:26:47 +0000 (20:26 +0000)
committerDimitry Andric <dimitry@andric.com>
Wed, 12 Oct 2016 20:26:47 +0000 (20:26 +0000)
Summary:
On FreeBSD, for ABI compatibility reasons, the pair trivial copy
constructor is disabled, using the aptly-named
`_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR` define.

Disable the related tests when this define is on, so they don't fail
unexpectedly.

Reviewers: emaste, rsmith, theraven, EricWF

Subscribers: cfe-commits

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

llvm-svn: 284047

libcxx/test/std/utilities/utility/pairs/pairs.pair/trivial_copy_move.pass.cpp

index 53cf567..200f044 100644 (file)
@@ -32,19 +32,25 @@ int main()
     typedef std::pair<int, short> P;
     {
         static_assert(std::is_copy_constructible<P>::value, "");
+#if !defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
         static_assert(std::is_trivially_copy_constructible<P>::value, "");
+#endif
     }
 #if TEST_STD_VER >= 11
     {
         static_assert(std::is_move_constructible<P>::value, "");
+#if !defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
         static_assert(std::is_trivially_move_constructible<P>::value, "");
+#endif
     }
     {
         using P1 = std::pair<Dummy, int>;
         static_assert(!std::is_copy_constructible<P1>::value, "");
         static_assert(!std::is_trivially_copy_constructible<P1>::value, "");
         static_assert(std::is_move_constructible<P1>::value, "");
+#if !defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
         static_assert(std::is_trivially_move_constructible<P1>::value, "");
+#endif
     }
 #endif
 }