diff options
| author | Howard Hinnant <hhinnant@apple.com> | 2010-08-22 00:59:46 +0000 |
|---|---|---|
| committer | Howard Hinnant <hhinnant@apple.com> | 2010-08-22 00:59:46 +0000 |
| commit | 94b2dd0998230c758abd92c99d3700c971f7a31a (patch) | |
| tree | 1b9f66ba0b4f8fd99fc02a112d4b7a30c4afe0f6 /libcxx/test/utilities/meta/meta.trans | |
| parent | d9c6c0b583ac1f1efeec3db571a1028a3c9b7a99 (diff) | |
| download | bcm5719-llvm-94b2dd0998230c758abd92c99d3700c971f7a31a.tar.gz bcm5719-llvm-94b2dd0998230c758abd92c99d3700c971f7a31a.zip | |
Fixing whitespace problems
llvm-svn: 111767
Diffstat (limited to 'libcxx/test/utilities/meta/meta.trans')
24 files changed, 879 insertions, 24 deletions
diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.arr/remove_all_extents.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.arr/remove_all_extents.pass.cpp index 51e5178cfd9..23b7646c3bb 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.arr/remove_all_extents.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.arr/remove_all_extents.pass.cpp @@ -1 +1,32 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// remove_all_extents
#include <type_traits>
enum Enum {zero, one_};
int main()
{
static_assert((std::is_same<std::remove_all_extents<int>::type, int>::value), "");
static_assert((std::is_same<std::remove_all_extents<const Enum>::type, const Enum>::value), "");
static_assert((std::is_same<std::remove_all_extents<int[]>::type, int>::value), "");
static_assert((std::is_same<std::remove_all_extents<const int[]>::type, const int>::value), "");
static_assert((std::is_same<std::remove_all_extents<int[3]>::type, int>::value), "");
static_assert((std::is_same<std::remove_all_extents<const int[3]>::type, const int>::value), "");
static_assert((std::is_same<std::remove_all_extents<int[][3]>::type, int>::value), "");
static_assert((std::is_same<std::remove_all_extents<const int[][3]>::type, const int>::value), "");
static_assert((std::is_same<std::remove_all_extents<int[2][3]>::type, int>::value), "");
static_assert((std::is_same<std::remove_all_extents<const int[2][3]>::type, const int>::value), "");
static_assert((std::is_same<std::remove_all_extents<int[1][2][3]>::type, int>::value), "");
static_assert((std::is_same<std::remove_all_extents<const int[1][2][3]>::type, const int>::value), "");
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// remove_all_extents + +#include <type_traits> + +enum Enum {zero, one_}; + +int main() +{ + static_assert((std::is_same<std::remove_all_extents<int>::type, int>::value), ""); + static_assert((std::is_same<std::remove_all_extents<const Enum>::type, const Enum>::value), ""); + static_assert((std::is_same<std::remove_all_extents<int[]>::type, int>::value), ""); + static_assert((std::is_same<std::remove_all_extents<const int[]>::type, const int>::value), ""); + static_assert((std::is_same<std::remove_all_extents<int[3]>::type, int>::value), ""); + static_assert((std::is_same<std::remove_all_extents<const int[3]>::type, const int>::value), ""); + static_assert((std::is_same<std::remove_all_extents<int[][3]>::type, int>::value), ""); + static_assert((std::is_same<std::remove_all_extents<const int[][3]>::type, const int>::value), ""); + static_assert((std::is_same<std::remove_all_extents<int[2][3]>::type, int>::value), ""); + static_assert((std::is_same<std::remove_all_extents<const int[2][3]>::type, const int>::value), ""); + static_assert((std::is_same<std::remove_all_extents<int[1][2][3]>::type, int>::value), ""); + static_assert((std::is_same<std::remove_all_extents<const int[1][2][3]>::type, const int>::value), ""); +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.arr/remove_extent.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.arr/remove_extent.pass.cpp index d6592e88377..3f7d07a7466 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.arr/remove_extent.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.arr/remove_extent.pass.cpp @@ -1 +1,32 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// remove_extent
#include <type_traits>
enum Enum {zero, one_};
int main()
{
static_assert((std::is_same<std::remove_extent<int>::type, int>::value), "");
static_assert((std::is_same<std::remove_extent<const Enum>::type, const Enum>::value), "");
static_assert((std::is_same<std::remove_extent<int[]>::type, int>::value), "");
static_assert((std::is_same<std::remove_extent<const int[]>::type, const int>::value), "");
static_assert((std::is_same<std::remove_extent<int[3]>::type, int>::value), "");
static_assert((std::is_same<std::remove_extent<const int[3]>::type, const int>::value), "");
static_assert((std::is_same<std::remove_extent<int[][3]>::type, int[3]>::value), "");
static_assert((std::is_same<std::remove_extent<const int[][3]>::type, const int[3]>::value), "");
static_assert((std::is_same<std::remove_extent<int[2][3]>::type, int[3]>::value), "");
static_assert((std::is_same<std::remove_extent<const int[2][3]>::type, const int[3]>::value), "");
static_assert((std::is_same<std::remove_extent<int[1][2][3]>::type, int[2][3]>::value), "");
static_assert((std::is_same<std::remove_extent<const int[1][2][3]>::type, const int[2][3]>::value), "");
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// remove_extent + +#include <type_traits> + +enum Enum {zero, one_}; + +int main() +{ + static_assert((std::is_same<std::remove_extent<int>::type, int>::value), ""); + static_assert((std::is_same<std::remove_extent<const Enum>::type, const Enum>::value), ""); + static_assert((std::is_same<std::remove_extent<int[]>::type, int>::value), ""); + static_assert((std::is_same<std::remove_extent<const int[]>::type, const int>::value), ""); + static_assert((std::is_same<std::remove_extent<int[3]>::type, int>::value), ""); + static_assert((std::is_same<std::remove_extent<const int[3]>::type, const int>::value), ""); + static_assert((std::is_same<std::remove_extent<int[][3]>::type, int[3]>::value), ""); + static_assert((std::is_same<std::remove_extent<const int[][3]>::type, const int[3]>::value), ""); + static_assert((std::is_same<std::remove_extent<int[2][3]>::type, int[3]>::value), ""); + static_assert((std::is_same<std::remove_extent<const int[2][3]>::type, const int[3]>::value), ""); + static_assert((std::is_same<std::remove_extent<int[1][2][3]>::type, int[2][3]>::value), ""); + static_assert((std::is_same<std::remove_extent<const int[1][2][3]>::type, const int[2][3]>::value), ""); +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_const.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_const.pass.cpp index 55767898c33..f9f20dfdf6c 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_const.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_const.pass.cpp @@ -1 +1,40 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// add_const
#include <type_traits>
template <class T, class U>
void test_add_const_imp()
{
static_assert((std::is_same<typename std::add_const<T>::type, const U>::value), "");
}
template <class T>
void test_add_const()
{
test_add_const_imp<T, const T>();
test_add_const_imp<const T, const T>();
test_add_const_imp<volatile T, volatile const T>();
test_add_const_imp<const volatile T, const volatile T>();
}
int main()
{
test_add_const<void>();
test_add_const<int>();
test_add_const<int[3]>();
test_add_const<int&>();
test_add_const<const int&>();
test_add_const<int*>();
test_add_const<const int*>();
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// add_const + +#include <type_traits> + +template <class T, class U> +void test_add_const_imp() +{ + static_assert((std::is_same<typename std::add_const<T>::type, const U>::value), ""); +} + +template <class T> +void test_add_const() +{ + test_add_const_imp<T, const T>(); + test_add_const_imp<const T, const T>(); + test_add_const_imp<volatile T, volatile const T>(); + test_add_const_imp<const volatile T, const volatile T>(); +} + +int main() +{ + test_add_const<void>(); + test_add_const<int>(); + test_add_const<int[3]>(); + test_add_const<int&>(); + test_add_const<const int&>(); + test_add_const<int*>(); + test_add_const<const int*>(); +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_cv.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_cv.pass.cpp index 43f516eab71..ae87afb5f1d 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_cv.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_cv.pass.cpp @@ -1 +1,40 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// add_cv
#include <type_traits>
template <class T, class U>
void test_add_cv_imp()
{
static_assert((std::is_same<typename std::add_cv<T>::type, const volatile U>::value), "");
}
template <class T>
void test_add_cv()
{
test_add_cv_imp<T, const volatile T>();
test_add_cv_imp<const T, const volatile T>();
test_add_cv_imp<volatile T, volatile const T>();
test_add_cv_imp<const volatile T, const volatile T>();
}
int main()
{
test_add_cv<void>();
test_add_cv<int>();
test_add_cv<int[3]>();
test_add_cv<int&>();
test_add_cv<const int&>();
test_add_cv<int*>();
test_add_cv<const int*>();
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// add_cv + +#include <type_traits> + +template <class T, class U> +void test_add_cv_imp() +{ + static_assert((std::is_same<typename std::add_cv<T>::type, const volatile U>::value), ""); +} + +template <class T> +void test_add_cv() +{ + test_add_cv_imp<T, const volatile T>(); + test_add_cv_imp<const T, const volatile T>(); + test_add_cv_imp<volatile T, volatile const T>(); + test_add_cv_imp<const volatile T, const volatile T>(); +} + +int main() +{ + test_add_cv<void>(); + test_add_cv<int>(); + test_add_cv<int[3]>(); + test_add_cv<int&>(); + test_add_cv<const int&>(); + test_add_cv<int*>(); + test_add_cv<const int*>(); +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_volatile.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_volatile.pass.cpp index cca30035925..fd82f953d30 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_volatile.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/add_volatile.pass.cpp @@ -1 +1,40 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// add_volatile
#include <type_traits>
template <class T, class U>
void test_add_volatile_imp()
{
static_assert((std::is_same<typename std::add_volatile<T>::type, volatile U>::value), "");
}
template <class T>
void test_add_volatile()
{
test_add_volatile_imp<T, volatile T>();
test_add_volatile_imp<const T, const volatile T>();
test_add_volatile_imp<volatile T, volatile T>();
test_add_volatile_imp<const volatile T, const volatile T>();
}
int main()
{
test_add_volatile<void>();
test_add_volatile<int>();
test_add_volatile<int[3]>();
test_add_volatile<int&>();
test_add_volatile<const int&>();
test_add_volatile<int*>();
test_add_volatile<const int*>();
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// add_volatile + +#include <type_traits> + +template <class T, class U> +void test_add_volatile_imp() +{ + static_assert((std::is_same<typename std::add_volatile<T>::type, volatile U>::value), ""); +} + +template <class T> +void test_add_volatile() +{ + test_add_volatile_imp<T, volatile T>(); + test_add_volatile_imp<const T, const volatile T>(); + test_add_volatile_imp<volatile T, volatile T>(); + test_add_volatile_imp<const volatile T, const volatile T>(); +} + +int main() +{ + test_add_volatile<void>(); + test_add_volatile<int>(); + test_add_volatile<int[3]>(); + test_add_volatile<int&>(); + test_add_volatile<const int&>(); + test_add_volatile<int*>(); + test_add_volatile<const int*>(); +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_const.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_const.pass.cpp index 4ecfcb8930d..f49a2b7092a 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_const.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_const.pass.cpp @@ -1 +1,40 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// remove_const
#include <type_traits>
template <class T, class U>
void test_remove_const_imp()
{
static_assert((std::is_same<typename std::remove_const<T>::type, U>::value), "");
}
template <class T>
void test_remove_const()
{
test_remove_const_imp<T, T>();
test_remove_const_imp<const T, T>();
test_remove_const_imp<volatile T, volatile T>();
test_remove_const_imp<const volatile T, volatile T>();
}
int main()
{
test_remove_const<void>();
test_remove_const<int>();
test_remove_const<int[3]>();
test_remove_const<int&>();
test_remove_const<const int&>();
test_remove_const<int*>();
test_remove_const<const int*>();
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// remove_const + +#include <type_traits> + +template <class T, class U> +void test_remove_const_imp() +{ + static_assert((std::is_same<typename std::remove_const<T>::type, U>::value), ""); +} + +template <class T> +void test_remove_const() +{ + test_remove_const_imp<T, T>(); + test_remove_const_imp<const T, T>(); + test_remove_const_imp<volatile T, volatile T>(); + test_remove_const_imp<const volatile T, volatile T>(); +} + +int main() +{ + test_remove_const<void>(); + test_remove_const<int>(); + test_remove_const<int[3]>(); + test_remove_const<int&>(); + test_remove_const<const int&>(); + test_remove_const<int*>(); + test_remove_const<const int*>(); +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_cv.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_cv.pass.cpp index fc5b36f4f68..137e093de30 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_cv.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_cv.pass.cpp @@ -1 +1,40 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// remove_cv
#include <type_traits>
template <class T, class U>
void test_remove_cv_imp()
{
static_assert((std::is_same<typename std::remove_cv<T>::type, U>::value), "");
}
template <class T>
void test_remove_cv()
{
test_remove_cv_imp<T, T>();
test_remove_cv_imp<const T, T>();
test_remove_cv_imp<volatile T, T>();
test_remove_cv_imp<const volatile T, T>();
}
int main()
{
test_remove_cv<void>();
test_remove_cv<int>();
test_remove_cv<int[3]>();
test_remove_cv<int&>();
test_remove_cv<const int&>();
test_remove_cv<int*>();
test_remove_cv<const int*>();
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// remove_cv + +#include <type_traits> + +template <class T, class U> +void test_remove_cv_imp() +{ + static_assert((std::is_same<typename std::remove_cv<T>::type, U>::value), ""); +} + +template <class T> +void test_remove_cv() +{ + test_remove_cv_imp<T, T>(); + test_remove_cv_imp<const T, T>(); + test_remove_cv_imp<volatile T, T>(); + test_remove_cv_imp<const volatile T, T>(); +} + +int main() +{ + test_remove_cv<void>(); + test_remove_cv<int>(); + test_remove_cv<int[3]>(); + test_remove_cv<int&>(); + test_remove_cv<const int&>(); + test_remove_cv<int*>(); + test_remove_cv<const int*>(); +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_volatile.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_volatile.pass.cpp index 85d65213c08..7c829433488 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_volatile.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.cv/remove_volatile.pass.cpp @@ -1 +1,40 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// remove_volatile
#include <type_traits>
template <class T, class U>
void test_remove_volatile_imp()
{
static_assert((std::is_same<typename std::remove_volatile<T>::type, U>::value), "");
}
template <class T>
void test_remove_volatile()
{
test_remove_volatile_imp<T, T>();
test_remove_volatile_imp<const T, const T>();
test_remove_volatile_imp<volatile T, T>();
test_remove_volatile_imp<const volatile T, const T>();
}
int main()
{
test_remove_volatile<void>();
test_remove_volatile<int>();
test_remove_volatile<int[3]>();
test_remove_volatile<int&>();
test_remove_volatile<const int&>();
test_remove_volatile<int*>();
test_remove_volatile<volatile int*>();
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// remove_volatile + +#include <type_traits> + +template <class T, class U> +void test_remove_volatile_imp() +{ + static_assert((std::is_same<typename std::remove_volatile<T>::type, U>::value), ""); +} + +template <class T> +void test_remove_volatile() +{ + test_remove_volatile_imp<T, T>(); + test_remove_volatile_imp<const T, const T>(); + test_remove_volatile_imp<volatile T, T>(); + test_remove_volatile_imp<const volatile T, const T>(); +} + +int main() +{ + test_remove_volatile<void>(); + test_remove_volatile<int>(); + test_remove_volatile<int[3]>(); + test_remove_volatile<int&>(); + test_remove_volatile<const int&>(); + test_remove_volatile<int*>(); + test_remove_volatile<volatile int*>(); +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp index 58be6e98024..55153de8efb 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp @@ -1 +1,123 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// aligned_storage
#include <type_traits>
int main()
{
{
typedef std::aligned_storage<10, 1 >::type T1;
static_assert(std::alignment_of<T1>::value == 1, "");
static_assert(sizeof(T1) == 10, "");
}
{
typedef std::aligned_storage<10, 2 >::type T1;
static_assert(std::alignment_of<T1>::value == 2, "");
static_assert(sizeof(T1) == 10, "");
}
{
typedef std::aligned_storage<10, 4 >::type T1;
static_assert(std::alignment_of<T1>::value == 4, "");
static_assert(sizeof(T1) == 12, "");
}
{
typedef std::aligned_storage<10, 8 >::type T1;
static_assert(std::alignment_of<T1>::value == 8, "");
static_assert(sizeof(T1) == 16, "");
}
{
typedef std::aligned_storage<10, 16 >::type T1;
static_assert(std::alignment_of<T1>::value == 16, "");
static_assert(sizeof(T1) == 16, "");
}
{
typedef std::aligned_storage<10, 32 >::type T1;
static_assert(std::alignment_of<T1>::value == 32, "");
static_assert(sizeof(T1) == 32, "");
}
{
typedef std::aligned_storage<20, 32 >::type T1;
static_assert(std::alignment_of<T1>::value == 32, "");
static_assert(sizeof(T1) == 32, "");
}
{
typedef std::aligned_storage<40, 32 >::type T1;
static_assert(std::alignment_of<T1>::value == 32, "");
static_assert(sizeof(T1) == 64, "");
}
{
typedef std::aligned_storage<12, 16 >::type T1;
static_assert(std::alignment_of<T1>::value == 16, "");
static_assert(sizeof(T1) == 16, "");
}
{
typedef std::aligned_storage<1>::type T1;
static_assert(std::alignment_of<T1>::value == 1, "");
static_assert(sizeof(T1) == 1, "");
}
{
typedef std::aligned_storage<2>::type T1;
static_assert(std::alignment_of<T1>::value == 2, "");
static_assert(sizeof(T1) == 2, "");
}
{
typedef std::aligned_storage<3>::type T1;
static_assert(std::alignment_of<T1>::value == 2, "");
static_assert(sizeof(T1) == 4, "");
}
{
typedef std::aligned_storage<4>::type T1;
static_assert(std::alignment_of<T1>::value == 4, "");
static_assert(sizeof(T1) == 4, "");
}
{
typedef std::aligned_storage<5>::type T1;
static_assert(std::alignment_of<T1>::value == 4, "");
static_assert(sizeof(T1) == 8, "");
}
{
typedef std::aligned_storage<7>::type T1;
static_assert(std::alignment_of<T1>::value == 4, "");
static_assert(sizeof(T1) == 8, "");
}
{
typedef std::aligned_storage<8>::type T1;
static_assert(std::alignment_of<T1>::value == (sizeof(long) == 4 ? 4 : 8), "");
static_assert(sizeof(T1) == 8, "");
}
{
typedef std::aligned_storage<9>::type T1;
static_assert(std::alignment_of<T1>::value == (sizeof(long) == 4 ? 4 : 8), "");
static_assert(sizeof(T1) == (sizeof(long) == 4 ? 12 : 16), "");
}
{
typedef std::aligned_storage<15>::type T1;
static_assert(std::alignment_of<T1>::value == (sizeof(long) == 4 ? 4 : 8), "");
static_assert(sizeof(T1) == 16, "");
}
{
typedef std::aligned_storage<16>::type T1;
static_assert(std::alignment_of<T1>::value == 16, "");
static_assert(sizeof(T1) == 16, "");
}
{
typedef std::aligned_storage<17>::type T1;
static_assert(std::alignment_of<T1>::value == 16, "");
static_assert(sizeof(T1) == 32, "");
}
{
typedef std::aligned_storage<10>::type T1;
static_assert(std::alignment_of<T1>::value == (sizeof(long) == 4 ? 4 : 8), "");
static_assert(sizeof(T1) == (sizeof(long) == 4 ? 12 : 16), "");
}
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// aligned_storage + +#include <type_traits> + +int main() +{ + { + typedef std::aligned_storage<10, 1 >::type T1; + static_assert(std::alignment_of<T1>::value == 1, ""); + static_assert(sizeof(T1) == 10, ""); + } + { + typedef std::aligned_storage<10, 2 >::type T1; + static_assert(std::alignment_of<T1>::value == 2, ""); + static_assert(sizeof(T1) == 10, ""); + } + { + typedef std::aligned_storage<10, 4 >::type T1; + static_assert(std::alignment_of<T1>::value == 4, ""); + static_assert(sizeof(T1) == 12, ""); + } + { + typedef std::aligned_storage<10, 8 >::type T1; + static_assert(std::alignment_of<T1>::value == 8, ""); + static_assert(sizeof(T1) == 16, ""); + } + { + typedef std::aligned_storage<10, 16 >::type T1; + static_assert(std::alignment_of<T1>::value == 16, ""); + static_assert(sizeof(T1) == 16, ""); + } + { + typedef std::aligned_storage<10, 32 >::type T1; + static_assert(std::alignment_of<T1>::value == 32, ""); + static_assert(sizeof(T1) == 32, ""); + } + { + typedef std::aligned_storage<20, 32 >::type T1; + static_assert(std::alignment_of<T1>::value == 32, ""); + static_assert(sizeof(T1) == 32, ""); + } + { + typedef std::aligned_storage<40, 32 >::type T1; + static_assert(std::alignment_of<T1>::value == 32, ""); + static_assert(sizeof(T1) == 64, ""); + } + { + typedef std::aligned_storage<12, 16 >::type T1; + static_assert(std::alignment_of<T1>::value == 16, ""); + static_assert(sizeof(T1) == 16, ""); + } + { + typedef std::aligned_storage<1>::type T1; + static_assert(std::alignment_of<T1>::value == 1, ""); + static_assert(sizeof(T1) == 1, ""); + } + { + typedef std::aligned_storage<2>::type T1; + static_assert(std::alignment_of<T1>::value == 2, ""); + static_assert(sizeof(T1) == 2, ""); + } + { + typedef std::aligned_storage<3>::type T1; + static_assert(std::alignment_of<T1>::value == 2, ""); + static_assert(sizeof(T1) == 4, ""); + } + { + typedef std::aligned_storage<4>::type T1; + static_assert(std::alignment_of<T1>::value == 4, ""); + static_assert(sizeof(T1) == 4, ""); + } + { + typedef std::aligned_storage<5>::type T1; + static_assert(std::alignment_of<T1>::value == 4, ""); + static_assert(sizeof(T1) == 8, ""); + } + { + typedef std::aligned_storage<7>::type T1; + static_assert(std::alignment_of<T1>::value == 4, ""); + static_assert(sizeof(T1) == 8, ""); + } + { + typedef std::aligned_storage<8>::type T1; + static_assert(std::alignment_of<T1>::value == (sizeof(long) == 4 ? 4 : 8), ""); + static_assert(sizeof(T1) == 8, ""); + } + { + typedef std::aligned_storage<9>::type T1; + static_assert(std::alignment_of<T1>::value == (sizeof(long) == 4 ? 4 : 8), ""); + static_assert(sizeof(T1) == (sizeof(long) == 4 ? 12 : 16), ""); + } + { + typedef std::aligned_storage<15>::type T1; + static_assert(std::alignment_of<T1>::value == (sizeof(long) == 4 ? 4 : 8), ""); + static_assert(sizeof(T1) == 16, ""); + } + { + typedef std::aligned_storage<16>::type T1; + static_assert(std::alignment_of<T1>::value == 16, ""); + static_assert(sizeof(T1) == 16, ""); + } + { + typedef std::aligned_storage<17>::type T1; + static_assert(std::alignment_of<T1>::value == 16, ""); + static_assert(sizeof(T1) == 32, ""); + } + { + typedef std::aligned_storage<10>::type T1; + static_assert(std::alignment_of<T1>::value == (sizeof(long) == 4 ? 4 : 8), ""); + static_assert(sizeof(T1) == (sizeof(long) == 4 ? 12 : 16), ""); + } +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp index 460f734a7b2..cc9e6a9d120 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp @@ -1 +1,26 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// common_type
#include <type_traits>
int main()
{
static_assert((std::is_same<std::common_type<int>::type, int>::value), "");
static_assert((std::is_same<std::common_type<char>::type, char>::value), "");
static_assert((std::is_same<std::common_type<double, char>::type, double>::value), "");
static_assert((std::is_same<std::common_type<short, char>::type, int>::value), "");
static_assert((std::is_same<std::common_type<double, char, long long>::type, double>::value), "");
static_assert((std::is_same<std::common_type<unsigned, char, long long>::type, long long>::value), "");
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// common_type + +#include <type_traits> + +int main() +{ + static_assert((std::is_same<std::common_type<int>::type, int>::value), ""); + static_assert((std::is_same<std::common_type<char>::type, char>::value), ""); + + static_assert((std::is_same<std::common_type<double, char>::type, double>::value), ""); + static_assert((std::is_same<std::common_type<short, char>::type, int>::value), ""); + + static_assert((std::is_same<std::common_type<double, char, long long>::type, double>::value), ""); + static_assert((std::is_same<std::common_type<unsigned, char, long long>::type, long long>::value), ""); +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/conditional.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/conditional.pass.cpp index c6317037a02..575814859f2 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/conditional.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/conditional.pass.cpp @@ -1 +1,20 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// conditional
#include <type_traits>
int main()
{
static_assert((std::is_same<std::conditional<true, char, int>::type, char>::value), "");
static_assert((std::is_same<std::conditional<false, char, int>::type, int>::value), "");
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// conditional + +#include <type_traits> + +int main() +{ + static_assert((std::is_same<std::conditional<true, char, int>::type, char>::value), ""); + static_assert((std::is_same<std::conditional<false, char, int>::type, int>::value), ""); +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp index 6ed6da8f804..a1cc8ec18e6 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp @@ -1 +1,31 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// decay
#include <type_traits>
template <class T, class U>
void test_decay()
{
static_assert((std::is_same<typename std::decay<T>::type, U>::value), "");
}
int main()
{
test_decay<void, void>();
test_decay<int, int>();
test_decay<const volatile int, int>();
test_decay<int*, int*>();
test_decay<int[3], int*>();
test_decay<const int[3], const int*>();
test_decay<void(), void (*)()>();
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// decay + +#include <type_traits> + +template <class T, class U> +void test_decay() +{ + static_assert((std::is_same<typename std::decay<T>::type, U>::value), ""); +} + +int main() +{ + test_decay<void, void>(); + test_decay<int, int>(); + test_decay<const volatile int, int>(); + test_decay<int*, int*>(); + test_decay<int[3], int*>(); + test_decay<const int[3], const int*>(); + test_decay<void(), void (*)()>(); +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/enable_if.fail.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/enable_if.fail.cpp index c4d27dc6b8e..d3a37dad10e 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/enable_if.fail.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/enable_if.fail.cpp @@ -1 +1,19 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// enable_if
#include <type_traits>
int main()
{
typedef std::enable_if<false>::type A;
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// enable_if + +#include <type_traits> + +int main() +{ + typedef std::enable_if<false>::type A; +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/enable_if.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/enable_if.pass.cpp index 7cfdeeecfcb..f39719e2594 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/enable_if.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/enable_if.pass.cpp @@ -1 +1,20 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// enable_if
#include <type_traits>
int main()
{
static_assert((std::is_same<std::enable_if<true>::type, void>::value), "");
static_assert((std::is_same<std::enable_if<true, int>::type, int>::value), "");
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// enable_if + +#include <type_traits> + +int main() +{ + static_assert((std::is_same<std::enable_if<true>::type, void>::value), ""); + static_assert((std::is_same<std::enable_if<true, int>::type, int>::value), ""); +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp index b1468de648a..b18b30b621b 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/result_of.pass.cpp @@ -1 +1,39 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <functional>
// result_of<Fn(ArgTypes...)>
#include <type_traits>
#include <memory>
typedef bool (&PF1)();
typedef short (*PF2)(long);
struct S
{
operator PF2() const;
double operator()(char, int&);
void calc(long) const;
char data_;
};
typedef void (S::*PMS)(long) const;
typedef char S::*PMD;
int main()
{
static_assert((std::is_same<std::result_of<S(int)>::type, short>::value), "Error!");
static_assert((std::is_same<std::result_of<S&(unsigned char, int&)>::type, double>::value), "Error!");
static_assert((std::is_same<std::result_of<PF1()>::type, bool>::value), "Error!");
// static_assert(std::is_same<std::result_of<PMS(std::unique_ptr<S>, int)>::type, void>::value, "Error!");
// static_assert(std::is_same<std::result_of<PMD(S)>::type, char&&>::value, "Error!");
// static_assert(std::is_same<std::result_of<PMD(const S*)>::type, const char&>::value, "Error!");
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// <functional> + +// result_of<Fn(ArgTypes...)> + +#include <type_traits> +#include <memory> + +typedef bool (&PF1)(); +typedef short (*PF2)(long); + +struct S +{ + operator PF2() const; + double operator()(char, int&); + void calc(long) const; + char data_; +}; + +typedef void (S::*PMS)(long) const; +typedef char S::*PMD; + +int main() +{ + static_assert((std::is_same<std::result_of<S(int)>::type, short>::value), "Error!"); + static_assert((std::is_same<std::result_of<S&(unsigned char, int&)>::type, double>::value), "Error!"); + static_assert((std::is_same<std::result_of<PF1()>::type, bool>::value), "Error!"); +// static_assert(std::is_same<std::result_of<PMS(std::unique_ptr<S>, int)>::type, void>::value, "Error!"); +// static_assert(std::is_same<std::result_of<PMD(S)>::type, char&&>::value, "Error!"); +// static_assert(std::is_same<std::result_of<PMD(const S*)>::type, const char&>::value, "Error!"); +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp index 128ca05adff..ba2b2bac724 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.other/underlying_type.pass.cpp @@ -1 +1,19 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// underlying_type
#include <type_traits>
int main()
{
#error underlying_type is not implemented
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// underlying_type + +#include <type_traits> + +int main() +{ +#error underlying_type is not implemented +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.ptr/add_pointer.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.ptr/add_pointer.pass.cpp index ad43c439916..d601e85c184 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.ptr/add_pointer.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.ptr/add_pointer.pass.cpp @@ -1 +1,31 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// add_pointer
#include <type_traits>
template <class T, class U>
void test_add_pointer()
{
static_assert((std::is_same<typename std::add_pointer<T>::type, U>::value), "");
}
int main()
{
test_add_pointer<void, void*>();
test_add_pointer<int, int*>();
test_add_pointer<int[3], int(*)[3]>();
test_add_pointer<int&, int*>();
test_add_pointer<const int&, const int*>();
test_add_pointer<int*, int**>();
test_add_pointer<const int*, const int**>();
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// add_pointer + +#include <type_traits> + +template <class T, class U> +void test_add_pointer() +{ + static_assert((std::is_same<typename std::add_pointer<T>::type, U>::value), ""); +} + +int main() +{ + test_add_pointer<void, void*>(); + test_add_pointer<int, int*>(); + test_add_pointer<int[3], int(*)[3]>(); + test_add_pointer<int&, int*>(); + test_add_pointer<const int&, const int*>(); + test_add_pointer<int*, int**>(); + test_add_pointer<const int*, const int**>(); +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.ptr/remove_pointer.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.ptr/remove_pointer.pass.cpp index 4b1b903e5cd..5156afc714b 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.ptr/remove_pointer.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.ptr/remove_pointer.pass.cpp @@ -1 +1,40 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// remove_pointer
#include <type_traits>
template <class T, class U>
void test_remove_pointer()
{
static_assert((std::is_same<typename std::remove_pointer<T>::type, U>::value), "");
}
int main()
{
test_remove_pointer<void, void>();
test_remove_pointer<int, int>();
test_remove_pointer<int[3], int[3]>();
test_remove_pointer<int*, int>();
test_remove_pointer<const int*, const int>();
test_remove_pointer<int**, int*>();
test_remove_pointer<int** const, int*>();
test_remove_pointer<int*const * , int* const>();
test_remove_pointer<const int** , const int*>();
test_remove_pointer<int&, int&>();
test_remove_pointer<const int&, const int&>();
test_remove_pointer<int(&)[3], int(&)[3]>();
test_remove_pointer<int(*)[3], int[3]>();
test_remove_pointer<int*&, int*&>();
test_remove_pointer<const int*&, const int*&>();
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// remove_pointer + +#include <type_traits> + +template <class T, class U> +void test_remove_pointer() +{ + static_assert((std::is_same<typename std::remove_pointer<T>::type, U>::value), ""); +} + +int main() +{ + test_remove_pointer<void, void>(); + test_remove_pointer<int, int>(); + test_remove_pointer<int[3], int[3]>(); + test_remove_pointer<int*, int>(); + test_remove_pointer<const int*, const int>(); + test_remove_pointer<int**, int*>(); + test_remove_pointer<int** const, int*>(); + test_remove_pointer<int*const * , int* const>(); + test_remove_pointer<const int** , const int*>(); + + test_remove_pointer<int&, int&>(); + test_remove_pointer<const int&, const int&>(); + test_remove_pointer<int(&)[3], int(&)[3]>(); + test_remove_pointer<int(*)[3], int[3]>(); + test_remove_pointer<int*&, int*&>(); + test_remove_pointer<const int*&, const int*&>(); +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp index 5dfea669906..3bb92fc81e1 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/add_lvalue_ref.pass.cpp @@ -1 +1,31 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// add_lvalue_reference
#include <type_traits>
template <class T, class U>
void test_add_lvalue_reference()
{
static_assert((std::is_same<typename std::add_lvalue_reference<T>::type, U>::value), "");
}
int main()
{
test_add_lvalue_reference<void, void>();
test_add_lvalue_reference<int, int&>();
test_add_lvalue_reference<int[3], int(&)[3]>();
test_add_lvalue_reference<int&, int&>();
test_add_lvalue_reference<const int&, const int&>();
test_add_lvalue_reference<int*, int*&>();
test_add_lvalue_reference<const int*, const int*&>();
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// add_lvalue_reference + +#include <type_traits> + +template <class T, class U> +void test_add_lvalue_reference() +{ + static_assert((std::is_same<typename std::add_lvalue_reference<T>::type, U>::value), ""); +} + +int main() +{ + test_add_lvalue_reference<void, void>(); + test_add_lvalue_reference<int, int&>(); + test_add_lvalue_reference<int[3], int(&)[3]>(); + test_add_lvalue_reference<int&, int&>(); + test_add_lvalue_reference<const int&, const int&>(); + test_add_lvalue_reference<int*, int*&>(); + test_add_lvalue_reference<const int*, const int*&>(); +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/add_rvalue_ref.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/add_rvalue_ref.pass.cpp index 0a86b53e5e1..cbfb7f4d75c 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/add_rvalue_ref.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/add_rvalue_ref.pass.cpp @@ -1 +1,37 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// add_rvalue_reference
#include <type_traits>
#ifdef _LIBCPP_MOVE
template <class T, class U>
void test_add_rvalue_reference()
{
static_assert((std::is_same<typename std::add_rvalue_reference<T>::type, U>::value), "");
}
#endif
int main()
{
#ifdef _LIBCPP_MOVE
test_add_rvalue_reference<void, void>();
test_add_rvalue_reference<int, int&&>();
test_add_rvalue_reference<int[3], int(&&)[3]>();
test_add_rvalue_reference<int&, int&>();
test_add_rvalue_reference<const int&, const int&>();
test_add_rvalue_reference<int*, int*&&>();
test_add_rvalue_reference<const int*, const int*&&>();
#endif
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// add_rvalue_reference + +#include <type_traits> + +#ifdef _LIBCPP_MOVE + +template <class T, class U> +void test_add_rvalue_reference() +{ + static_assert((std::is_same<typename std::add_rvalue_reference<T>::type, U>::value), ""); +} + +#endif // _LIBCPP_MOVE + +int main() +{ +#ifdef _LIBCPP_MOVE + test_add_rvalue_reference<void, void>(); + test_add_rvalue_reference<int, int&&>(); + test_add_rvalue_reference<int[3], int(&&)[3]>(); + test_add_rvalue_reference<int&, int&>(); + test_add_rvalue_reference<const int&, const int&>(); + test_add_rvalue_reference<int*, int*&&>(); + test_add_rvalue_reference<const int*, const int*&&>(); +#endif // _LIBCPP_MOVE +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/remove_ref.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/remove_ref.pass.cpp index d36dd019b07..b42b0b504a3 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/remove_ref.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.ref/remove_ref.pass.cpp @@ -1 +1,43 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// remove_reference
#include <type_traits>
template <class T, class U>
void test_remove_reference()
{
static_assert((std::is_same<typename std::remove_reference<T>::type, U>::value), "");
}
int main()
{
test_remove_reference<void, void>();
test_remove_reference<int, int>();
test_remove_reference<int[3], int[3]>();
test_remove_reference<int*, int*>();
test_remove_reference<const int*, const int*>();
test_remove_reference<int&, int>();
test_remove_reference<const int&, const int>();
test_remove_reference<int(&)[3], int[3]>();
test_remove_reference<int*&, int*>();
test_remove_reference<const int*&, const int*>();
#ifdef _LIBCPP_MOVE
test_remove_reference<int&&, int>();
test_remove_reference<const int&&, const int>();
test_remove_reference<int(&&)[3], int[3]>();
test_remove_reference<int*&&, int*>();
test_remove_reference<const int*&&, const int*>();
#endif
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// remove_reference + +#include <type_traits> + +template <class T, class U> +void test_remove_reference() +{ + static_assert((std::is_same<typename std::remove_reference<T>::type, U>::value), ""); +} + +int main() +{ + test_remove_reference<void, void>(); + test_remove_reference<int, int>(); + test_remove_reference<int[3], int[3]>(); + test_remove_reference<int*, int*>(); + test_remove_reference<const int*, const int*>(); + + test_remove_reference<int&, int>(); + test_remove_reference<const int&, const int>(); + test_remove_reference<int(&)[3], int[3]>(); + test_remove_reference<int*&, int*>(); + test_remove_reference<const int*&, const int*>(); + +#ifdef _LIBCPP_MOVE + test_remove_reference<int&&, int>(); + test_remove_reference<const int&&, const int>(); + test_remove_reference<int(&&)[3], int[3]>(); + test_remove_reference<int*&&, int*>(); + test_remove_reference<const int*&&, const int*>(); +#endif // _LIBCPP_MOVE +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.sign/make_signed.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.sign/make_signed.pass.cpp index 3b87a835512..5d369daea49 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.sign/make_signed.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.sign/make_signed.pass.cpp @@ -1 +1,42 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// make_signed
#include <type_traits>
enum Enum {zero, one_};
enum BigEnum
{
bzero,
big = 0xFFFFFFFFFFFFFFFFULL
};
int main()
{
static_assert((std::is_same<std::make_signed<signed char>::type, signed char>::value), "");
static_assert((std::is_same<std::make_signed<unsigned char>::type, signed char>::value), "");
static_assert((std::is_same<std::make_signed<char>::type, signed char>::value), "");
static_assert((std::is_same<std::make_signed<short>::type, signed short>::value), "");
static_assert((std::is_same<std::make_signed<unsigned short>::type, signed short>::value), "");
static_assert((std::is_same<std::make_signed<int>::type, signed int>::value), "");
static_assert((std::is_same<std::make_signed<unsigned int>::type, signed int>::value), "");
static_assert((std::is_same<std::make_signed<long>::type, signed long>::value), "");
static_assert((std::is_same<std::make_signed<unsigned long>::type, long>::value), "");
static_assert((std::is_same<std::make_signed<long long>::type, signed long long>::value), "");
static_assert((std::is_same<std::make_signed<unsigned long long>::type, signed long long>::value), "");
static_assert((std::is_same<std::make_signed<wchar_t>::type, int>::value), "");
static_assert((std::is_same<std::make_signed<const wchar_t>::type, const int>::value), "");
static_assert((std::is_same<std::make_signed<const Enum>::type, const int>::value), "");
static_assert((std::is_same<std::make_signed<BigEnum>::type,
std::conditional<sizeof(long) == 4, long long, long>::type>::value), "");
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// make_signed + +#include <type_traits> + +enum Enum {zero, one_}; + +enum BigEnum +{ + bzero, + big = 0xFFFFFFFFFFFFFFFFULL +}; + +int main() +{ + static_assert((std::is_same<std::make_signed<signed char>::type, signed char>::value), ""); + static_assert((std::is_same<std::make_signed<unsigned char>::type, signed char>::value), ""); + static_assert((std::is_same<std::make_signed<char>::type, signed char>::value), ""); + static_assert((std::is_same<std::make_signed<short>::type, signed short>::value), ""); + static_assert((std::is_same<std::make_signed<unsigned short>::type, signed short>::value), ""); + static_assert((std::is_same<std::make_signed<int>::type, signed int>::value), ""); + static_assert((std::is_same<std::make_signed<unsigned int>::type, signed int>::value), ""); + static_assert((std::is_same<std::make_signed<long>::type, signed long>::value), ""); + static_assert((std::is_same<std::make_signed<unsigned long>::type, long>::value), ""); + static_assert((std::is_same<std::make_signed<long long>::type, signed long long>::value), ""); + static_assert((std::is_same<std::make_signed<unsigned long long>::type, signed long long>::value), ""); + static_assert((std::is_same<std::make_signed<wchar_t>::type, int>::value), ""); + static_assert((std::is_same<std::make_signed<const wchar_t>::type, const int>::value), ""); + static_assert((std::is_same<std::make_signed<const Enum>::type, const int>::value), ""); + static_assert((std::is_same<std::make_signed<BigEnum>::type, + std::conditional<sizeof(long) == 4, long long, long>::type>::value), ""); +} diff --git a/libcxx/test/utilities/meta/meta.trans/meta.trans.sign/make_unsigned.pass.cpp b/libcxx/test/utilities/meta/meta.trans/meta.trans.sign/make_unsigned.pass.cpp index d8bb4e33ef7..a029acb83ec 100644 --- a/libcxx/test/utilities/meta/meta.trans/meta.trans.sign/make_unsigned.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/meta.trans.sign/make_unsigned.pass.cpp @@ -1 +1,42 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// type_traits
// make_unsigned
#include <type_traits>
enum Enum {zero, one_};
enum BigEnum
{
bzero,
big = 0xFFFFFFFFFFFFFFFFULL
};
int main()
{
static_assert((std::is_same<std::make_unsigned<signed char>::type, unsigned char>::value), "");
static_assert((std::is_same<std::make_unsigned<unsigned char>::type, unsigned char>::value), "");
static_assert((std::is_same<std::make_unsigned<char>::type, unsigned char>::value), "");
static_assert((std::is_same<std::make_unsigned<short>::type, unsigned short>::value), "");
static_assert((std::is_same<std::make_unsigned<unsigned short>::type, unsigned short>::value), "");
static_assert((std::is_same<std::make_unsigned<int>::type, unsigned int>::value), "");
static_assert((std::is_same<std::make_unsigned<unsigned int>::type, unsigned int>::value), "");
static_assert((std::is_same<std::make_unsigned<long>::type, unsigned long>::value), "");
static_assert((std::is_same<std::make_unsigned<unsigned long>::type, unsigned long>::value), "");
static_assert((std::is_same<std::make_unsigned<long long>::type, unsigned long long>::value), "");
static_assert((std::is_same<std::make_unsigned<unsigned long long>::type, unsigned long long>::value), "");
static_assert((std::is_same<std::make_unsigned<wchar_t>::type, unsigned int>::value), "");
static_assert((std::is_same<std::make_unsigned<const wchar_t>::type, const unsigned int>::value), "");
static_assert((std::is_same<std::make_unsigned<const Enum>::type, const unsigned int>::value), "");
static_assert((std::is_same<std::make_unsigned<BigEnum>::type,
std::conditional<sizeof(long) == 4, unsigned long long, unsigned long>::type>::value), "");
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// type_traits + +// make_unsigned + +#include <type_traits> + +enum Enum {zero, one_}; + +enum BigEnum +{ + bzero, + big = 0xFFFFFFFFFFFFFFFFULL +}; + +int main() +{ + static_assert((std::is_same<std::make_unsigned<signed char>::type, unsigned char>::value), ""); + static_assert((std::is_same<std::make_unsigned<unsigned char>::type, unsigned char>::value), ""); + static_assert((std::is_same<std::make_unsigned<char>::type, unsigned char>::value), ""); + static_assert((std::is_same<std::make_unsigned<short>::type, unsigned short>::value), ""); + static_assert((std::is_same<std::make_unsigned<unsigned short>::type, unsigned short>::value), ""); + static_assert((std::is_same<std::make_unsigned<int>::type, unsigned int>::value), ""); + static_assert((std::is_same<std::make_unsigned<unsigned int>::type, unsigned int>::value), ""); + static_assert((std::is_same<std::make_unsigned<long>::type, unsigned long>::value), ""); + static_assert((std::is_same<std::make_unsigned<unsigned long>::type, unsigned long>::value), ""); + static_assert((std::is_same<std::make_unsigned<long long>::type, unsigned long long>::value), ""); + static_assert((std::is_same<std::make_unsigned<unsigned long long>::type, unsigned long long>::value), ""); + static_assert((std::is_same<std::make_unsigned<wchar_t>::type, unsigned int>::value), ""); + static_assert((std::is_same<std::make_unsigned<const wchar_t>::type, const unsigned int>::value), ""); + static_assert((std::is_same<std::make_unsigned<const Enum>::type, const unsigned int>::value), ""); + static_assert((std::is_same<std::make_unsigned<BigEnum>::type, + std::conditional<sizeof(long) == 4, unsigned long long, unsigned long>::type>::value), ""); +} diff --git a/libcxx/test/utilities/meta/meta.trans/nothing_to_do.pass.cpp b/libcxx/test/utilities/meta/meta.trans/nothing_to_do.pass.cpp index e8db90cbee0..b89f168e9c4 100644 --- a/libcxx/test/utilities/meta/meta.trans/nothing_to_do.pass.cpp +++ b/libcxx/test/utilities/meta/meta.trans/nothing_to_do.pass.cpp @@ -1 +1,12 @@ -//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
int main()
{
}
\ No newline at end of file +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +int main() +{ +} |

