summaryrefslogtreecommitdiffstats
path: root/libcxx/test/utilities/utility/pairs/pairs.spec
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/utilities/utility/pairs/pairs.spec')
-rw-r--r--libcxx/test/utilities/utility/pairs/pairs.spec/comparison.pass.cpp95
-rw-r--r--libcxx/test/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp51
-rw-r--r--libcxx/test/utilities/utility/pairs/pairs.spec/non_member_swap.pass.cpp31
3 files changed, 0 insertions, 177 deletions
diff --git a/libcxx/test/utilities/utility/pairs/pairs.spec/comparison.pass.cpp b/libcxx/test/utilities/utility/pairs/pairs.spec/comparison.pass.cpp
deleted file mode 100644
index 9ba8532ab29..00000000000
--- a/libcxx/test/utilities/utility/pairs/pairs.spec/comparison.pass.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <utility>
-
-// template <class T1, class T2> struct pair
-
-// template <class T1, class T2> bool operator==(const pair<T1,T2>&, const pair<T1,T2>&);
-// template <class T1, class T2> bool operator!=(const pair<T1,T2>&, const pair<T1,T2>&);
-// template <class T1, class T2> bool operator< (const pair<T1,T2>&, const pair<T1,T2>&);
-// template <class T1, class T2> bool operator> (const pair<T1,T2>&, const pair<T1,T2>&);
-// template <class T1, class T2> bool operator>=(const pair<T1,T2>&, const pair<T1,T2>&);
-// template <class T1, class T2> bool operator<=(const pair<T1,T2>&, const pair<T1,T2>&);
-
-#include <utility>
-#include <cassert>
-
-int main()
-{
- {
- typedef std::pair<int, short> P;
- P p1(3, 4);
- P p2(3, 4);
- assert( (p1 == p2));
- assert(!(p1 != p2));
- assert(!(p1 < p2));
- assert( (p1 <= p2));
- assert(!(p1 > p2));
- assert( (p1 >= p2));
- }
- {
- typedef std::pair<int, short> P;
- P p1(2, 4);
- P p2(3, 4);
- assert(!(p1 == p2));
- assert( (p1 != p2));
- assert( (p1 < p2));
- assert( (p1 <= p2));
- assert(!(p1 > p2));
- assert(!(p1 >= p2));
- }
- {
- typedef std::pair<int, short> P;
- P p1(3, 2);
- P p2(3, 4);
- assert(!(p1 == p2));
- assert( (p1 != p2));
- assert( (p1 < p2));
- assert( (p1 <= p2));
- assert(!(p1 > p2));
- assert(!(p1 >= p2));
- }
- {
- typedef std::pair<int, short> P;
- P p1(3, 4);
- P p2(2, 4);
- assert(!(p1 == p2));
- assert( (p1 != p2));
- assert(!(p1 < p2));
- assert(!(p1 <= p2));
- assert( (p1 > p2));
- assert( (p1 >= p2));
- }
- {
- typedef std::pair<int, short> P;
- P p1(3, 4);
- P p2(3, 2);
- assert(!(p1 == p2));
- assert( (p1 != p2));
- assert(!(p1 < p2));
- assert(!(p1 <= p2));
- assert( (p1 > p2));
- assert( (p1 >= p2));
- }
-
-#if _LIBCPP_STD_VER > 11
- {
- typedef std::pair<int, short> P;
- constexpr P p1(3, 4);
- constexpr P p2(3, 2);
- static_assert(!(p1 == p2), "");
- static_assert( (p1 != p2), "");
- static_assert(!(p1 < p2), "");
- static_assert(!(p1 <= p2), "");
- static_assert( (p1 > p2), "");
- static_assert( (p1 >= p2), "");
- }
-#endif
-}
diff --git a/libcxx/test/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp b/libcxx/test/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp
deleted file mode 100644
index 48e09735abb..00000000000
--- a/libcxx/test/utilities/utility/pairs/pairs.spec/make_pair.pass.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <utility>
-
-// template <class T1, class T2> pair<V1, V2> make_pair(T1&&, T2&&);
-
-#include <utility>
-#include <memory>
-#include <cassert>
-
-int main()
-{
- {
- typedef std::pair<int, short> P1;
- P1 p1 = std::make_pair(3, 4);
- assert(p1.first == 3);
- assert(p1.second == 4);
- }
-
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
- {
- typedef std::pair<std::unique_ptr<int>, short> P1;
- P1 p1 = std::make_pair(std::unique_ptr<int>(new int(3)), 4);
- assert(*p1.first == 3);
- assert(p1.second == 4);
- }
- {
- typedef std::pair<std::unique_ptr<int>, short> P1;
- P1 p1 = std::make_pair(nullptr, 4);
- assert(p1.first == nullptr);
- assert(p1.second == 4);
- }
-#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
-#if _LIBCPP_STD_VER > 11
- {
- typedef std::pair<int, short> P1;
- constexpr P1 p1 = std::make_pair(3, 4);
- static_assert(p1.first == 3, "");
- static_assert(p1.second == 4, "");
- }
-#endif
-
-}
diff --git a/libcxx/test/utilities/utility/pairs/pairs.spec/non_member_swap.pass.cpp b/libcxx/test/utilities/utility/pairs/pairs.spec/non_member_swap.pass.cpp
deleted file mode 100644
index d9d8f27b522..00000000000
--- a/libcxx/test/utilities/utility/pairs/pairs.spec/non_member_swap.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <utility>
-
-// template <class T1, class T2> struct pair
-
-// template <class T1, class T2> void swap(pair<T1, T2>& x, pair<T1, T2>& y);
-
-#include <utility>
-#include <cassert>
-
-int main()
-{
- {
- typedef std::pair<int, short> P1;
- P1 p1(3, 4);
- P1 p2(5, 6);
- swap(p1, p2);
- assert(p1.first == 5);
- assert(p1.second == 6);
- assert(p2.first == 3);
- assert(p2.second == 4);
- }
-}
OpenPOWER on IntegriCloud