summaryrefslogtreecommitdiffstats
path: root/libcxx/test/utilities/meta/meta.unary.prop.query
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/utilities/meta/meta.unary.prop.query')
-rw-r--r--libcxx/test/utilities/meta/meta.unary.prop.query/alignment_of.pass.cpp47
-rw-r--r--libcxx/test/utilities/meta/meta.unary.prop.query/extent.pass.cpp60
-rw-r--r--libcxx/test/utilities/meta/meta.unary.prop.query/rank.pass.cpp46
-rw-r--r--libcxx/test/utilities/meta/meta.unary.prop.query/void_t.pass.cpp69
4 files changed, 0 insertions, 222 deletions
diff --git a/libcxx/test/utilities/meta/meta.unary.prop.query/alignment_of.pass.cpp b/libcxx/test/utilities/meta/meta.unary.prop.query/alignment_of.pass.cpp
deleted file mode 100644
index 6ea1cac789e..00000000000
--- a/libcxx/test/utilities/meta/meta.unary.prop.query/alignment_of.pass.cpp
+++ /dev/null
@@ -1,47 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// type_traits
-
-// alignment_of
-
-#include <type_traits>
-#include <cstdint>
-
-template <class T, unsigned A>
-void test_alignment_of()
-{
- static_assert( std::alignment_of<T>::value == A, "");
- static_assert( std::alignment_of<const T>::value == A, "");
- static_assert( std::alignment_of<volatile T>::value == A, "");
- static_assert( std::alignment_of<const volatile T>::value == A, "");
-}
-
-class Class
-{
-public:
- ~Class();
-};
-
-int main()
-{
- test_alignment_of<int&, 4>();
- test_alignment_of<Class, 1>();
- test_alignment_of<int*, sizeof(intptr_t)>();
- test_alignment_of<const int*, sizeof(intptr_t)>();
- test_alignment_of<char[3], 1>();
- test_alignment_of<int, 4>();
- test_alignment_of<double, 8>();
-#if (defined(__ppc__) && !defined(__ppc64__))
- test_alignment_of<bool, 4>(); // 32-bit PPC has four byte bool
-#else
- test_alignment_of<bool, 1>();
-#endif
- test_alignment_of<unsigned, 4>();
-}
diff --git a/libcxx/test/utilities/meta/meta.unary.prop.query/extent.pass.cpp b/libcxx/test/utilities/meta/meta.unary.prop.query/extent.pass.cpp
deleted file mode 100644
index a99dc694852..00000000000
--- a/libcxx/test/utilities/meta/meta.unary.prop.query/extent.pass.cpp
+++ /dev/null
@@ -1,60 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// type_traits
-
-// extent
-
-#include <type_traits>
-
-template <class T, unsigned A>
-void test_extent()
-{
- static_assert((std::extent<T>::value == A), "");
- static_assert((std::extent<const T>::value == A), "");
- static_assert((std::extent<volatile T>::value == A), "");
- static_assert((std::extent<const volatile T>::value == A), "");
-}
-
-template <class T, unsigned A>
-void test_extent1()
-{
- static_assert((std::extent<T, 1>::value == A), "");
- static_assert((std::extent<const T, 1>::value == A), "");
- static_assert((std::extent<volatile T, 1>::value == A), "");
- static_assert((std::extent<const volatile T, 1>::value == A), "");
-}
-
-class Class
-{
-public:
- ~Class();
-};
-
-int main()
-{
- test_extent<void, 0>();
- test_extent<int&, 0>();
- test_extent<Class, 0>();
- test_extent<int*, 0>();
- test_extent<const int*, 0>();
- test_extent<int, 0>();
- test_extent<double, 0>();
- test_extent<bool, 0>();
- test_extent<unsigned, 0>();
-
- test_extent<int[2], 2>();
- test_extent<int[2][4], 2>();
- test_extent<int[][4], 0>();
-
- test_extent1<int, 0>();
- test_extent1<int[2], 0>();
- test_extent1<int[2][4], 4>();
- test_extent1<int[][4], 4>();
-}
diff --git a/libcxx/test/utilities/meta/meta.unary.prop.query/rank.pass.cpp b/libcxx/test/utilities/meta/meta.unary.prop.query/rank.pass.cpp
deleted file mode 100644
index 06f66a92c7c..00000000000
--- a/libcxx/test/utilities/meta/meta.unary.prop.query/rank.pass.cpp
+++ /dev/null
@@ -1,46 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// type_traits
-
-// rank
-
-#include <type_traits>
-
-template <class T, unsigned A>
-void test_rank()
-{
- static_assert( std::rank<T>::value == A, "");
- static_assert( std::rank<const T>::value == A, "");
- static_assert( std::rank<volatile T>::value == A, "");
- static_assert( std::rank<const volatile T>::value == A, "");
-}
-
-class Class
-{
-public:
- ~Class();
-};
-
-int main()
-{
- test_rank<void, 0>();
- test_rank<int&, 0>();
- test_rank<Class, 0>();
- test_rank<int*, 0>();
- test_rank<const int*, 0>();
- test_rank<int, 0>();
- test_rank<double, 0>();
- test_rank<bool, 0>();
- test_rank<unsigned, 0>();
-
- test_rank<char[3], 1>();
- test_rank<char[][3], 2>();
- test_rank<char[][4][3], 3>();
-}
diff --git a/libcxx/test/utilities/meta/meta.unary.prop.query/void_t.pass.cpp b/libcxx/test/utilities/meta/meta.unary.prop.query/void_t.pass.cpp
deleted file mode 100644
index 1f99a74d9b6..00000000000
--- a/libcxx/test/utilities/meta/meta.unary.prop.query/void_t.pass.cpp
+++ /dev/null
@@ -1,69 +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.
-//
-//===----------------------------------------------------------------------===//
-
-// type_traits
-
-// void_t
-
-#include <type_traits>
-
-#if _LIBCPP_STD_VER <= 14
-int main () {}
-#else
-
-template <class T>
-void test1()
-{
- static_assert( std::is_same<void, std::void_t<T>>::value, "");
- static_assert( std::is_same<void, std::void_t<const T>>::value, "");
- static_assert( std::is_same<void, std::void_t<volatile T>>::value, "");
- static_assert( std::is_same<void, std::void_t<const volatile T>>::value, "");
-}
-
-template <class T, class U>
-void test2()
-{
- static_assert( std::is_same<void, std::void_t<T, U>>::value, "");
- static_assert( std::is_same<void, std::void_t<const T, U>>::value, "");
- static_assert( std::is_same<void, std::void_t<volatile T, U>>::value, "");
- static_assert( std::is_same<void, std::void_t<const volatile T, U>>::value, "");
-
- static_assert( std::is_same<void, std::void_t<T, const U>>::value, "");
- static_assert( std::is_same<void, std::void_t<const T, const U>>::value, "");
- static_assert( std::is_same<void, std::void_t<volatile T, const U>>::value, "");
- static_assert( std::is_same<void, std::void_t<const volatile T, const U>>::value, "");
-}
-
-class Class
-{
-public:
- ~Class();
-};
-
-int main()
-{
- static_assert( std::is_same<void, std::void_t<>>::value, "");
-
- test1<void>();
- test1<int>();
- test1<double>();
- test1<int&>();
- test1<Class>();
- test1<Class[]>();
- test1<Class[5]>();
-
- test2<void, int>();
- test2<double, int>();
- test2<int&, int>();
- test2<Class&, bool>();
- test2<void *, int&>();
-
- static_assert( std::is_same<void, std::void_t<int, double const &, Class, volatile int[], void>>::value, "");
-}
-#endif
OpenPOWER on IntegriCloud