[libcxx-commits] [libcxx] r369597 - libcxx: Rename last two .hpp files in libcxx to .h
Nico Weber via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Aug 21 15:38:38 PDT 2019
Author: nico
Date: Wed Aug 21 15:38:38 2019
New Revision: 369597
URL: http://llvm.org/viewvc/llvm-project?rev=369597&view=rev
Log:
libcxx: Rename last two .hpp files in libcxx to .h
Differential Revision: https://reviews.llvm.org/D66544
Added:
libcxx/trunk/test/std/input.output/filesystems/fs.enum/check_bitmask_types.h
libcxx/trunk/test/std/utilities/function.objects/comparisons/pointer_comparison_test_helper.h
Removed:
libcxx/trunk/test/std/input.output/filesystems/fs.enum/check_bitmask_types.hpp
libcxx/trunk/test/std/utilities/function.objects/comparisons/pointer_comparison_test_helper.hpp
Modified:
libcxx/trunk/test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp
libcxx/trunk/test/std/input.output/filesystems/fs.enum/enum.directory_options.pass.cpp
libcxx/trunk/test/std/input.output/filesystems/fs.enum/enum.perm_options.pass.cpp
libcxx/trunk/test/std/input.output/filesystems/fs.enum/enum.perms.pass.cpp
libcxx/trunk/test/std/utilities/function.objects/comparisons/greater.pass.cpp
libcxx/trunk/test/std/utilities/function.objects/comparisons/greater_equal.pass.cpp
libcxx/trunk/test/std/utilities/function.objects/comparisons/less.pass.cpp
libcxx/trunk/test/std/utilities/function.objects/comparisons/less_equal.pass.cpp
Added: libcxx/trunk/test/std/input.output/filesystems/fs.enum/check_bitmask_types.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/filesystems/fs.enum/check_bitmask_types.h?rev=369597&view=auto
==============================================================================
--- libcxx/trunk/test/std/input.output/filesystems/fs.enum/check_bitmask_types.h (added)
+++ libcxx/trunk/test/std/input.output/filesystems/fs.enum/check_bitmask_types.h Wed Aug 21 15:38:38 2019
@@ -0,0 +1,75 @@
+#ifndef TEST_BITMASK_TYPE_H
+#define TEST_BITMASK_TYPE_H
+
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+
+template <class EnumType, EnumType Val1, EnumType Val2,
+ class UT = typename std::underlying_type<EnumType>::type,
+ UT UVal1 = static_cast<UT>(Val1),
+ UT UVal2 = static_cast<UT>(Val2),
+ UT UZero = static_cast<UT>(0),
+ EnumType Zero = static_cast<EnumType>(0)
+ >
+struct check_bitmask_type {
+
+ static constexpr UT dcast(EnumType e) { return static_cast<UT>(e); }
+ static constexpr UT unpromote(decltype((~UZero)) promoted) { return static_cast<UT>(promoted); }
+ // We need two values that are non-zero and share at least one bit.
+ static_assert(Val1 != Zero && Val2 != Zero, "");
+ static_assert(Val1 != Val2, "");
+ static_assert((UVal1 & UVal2) == 0, "");
+
+
+ static bool check()
+ {
+ {
+ EnumType ValRef = Val1;
+ ASSERT_SAME_TYPE(EnumType, decltype(Val1 & Val2));
+ ASSERT_SAME_TYPE(EnumType, decltype(Val1 | Val2));
+ ASSERT_SAME_TYPE(EnumType, decltype(Val1 ^ Val2));
+ ASSERT_SAME_TYPE(EnumType, decltype((~Val1)));
+ ASSERT_SAME_TYPE(EnumType&, decltype(ValRef &= Val2));
+ ASSERT_SAME_TYPE(EnumType&, decltype(ValRef |= Val2));
+ ASSERT_SAME_TYPE(EnumType&, decltype(ValRef ^= Val2));
+ }
+
+ static_assert((Val1 & Zero) == Zero, "");
+ static_assert((Val1 & Val1) == Val1, "");
+ static_assert(dcast(Val1 & Val2) == (UVal1 & UVal2), "");
+
+ static_assert((Val1 | Zero) == Val1, "");
+ static_assert(dcast(Val1 | Val2) == (UVal1 | UVal2), "");
+
+ static_assert((Val1 ^ Zero) == Val1, "");
+ static_assert(dcast(Val1 ^ Val2) == (UVal1 ^ UVal2), "");
+
+ static_assert(dcast(~Zero) == unpromote(~UZero), "");
+ static_assert(dcast(~Val1) == unpromote(~UVal1), "");
+
+ {
+ EnumType e = Val1;
+ EnumType& eref = (e &= Val2);
+ assert(&eref == &e);
+ assert(dcast(eref) == (UVal1 & UVal2));
+ }
+ {
+ EnumType e = Val1;
+ EnumType& eref = (e |= Val2);
+ assert(&eref == &e);
+ assert(dcast(eref) == (UVal1 | UVal2));
+ }
+ {
+ EnumType e = Val1;
+ EnumType& eref = (e ^= Val2);
+ assert(&eref == &e);
+ assert(dcast(eref) == (UVal1 ^ UVal2));
+ }
+ return true;
+ }
+};
+
+#endif // TEST_BITMASK_TYPE
Removed: libcxx/trunk/test/std/input.output/filesystems/fs.enum/check_bitmask_types.hpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/filesystems/fs.enum/check_bitmask_types.hpp?rev=369596&view=auto
==============================================================================
--- libcxx/trunk/test/std/input.output/filesystems/fs.enum/check_bitmask_types.hpp (original)
+++ libcxx/trunk/test/std/input.output/filesystems/fs.enum/check_bitmask_types.hpp (removed)
@@ -1,75 +0,0 @@
-#ifndef TEST_BITMASK_TYPE_HPP
-#define TEST_BITMASK_TYPE_HPP
-
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-
-template <class EnumType, EnumType Val1, EnumType Val2,
- class UT = typename std::underlying_type<EnumType>::type,
- UT UVal1 = static_cast<UT>(Val1),
- UT UVal2 = static_cast<UT>(Val2),
- UT UZero = static_cast<UT>(0),
- EnumType Zero = static_cast<EnumType>(0)
- >
-struct check_bitmask_type {
-
- static constexpr UT dcast(EnumType e) { return static_cast<UT>(e); }
- static constexpr UT unpromote(decltype((~UZero)) promoted) { return static_cast<UT>(promoted); }
- // We need two values that are non-zero and share at least one bit.
- static_assert(Val1 != Zero && Val2 != Zero, "");
- static_assert(Val1 != Val2, "");
- static_assert((UVal1 & UVal2) == 0, "");
-
-
- static bool check()
- {
- {
- EnumType ValRef = Val1;
- ASSERT_SAME_TYPE(EnumType, decltype(Val1 & Val2));
- ASSERT_SAME_TYPE(EnumType, decltype(Val1 | Val2));
- ASSERT_SAME_TYPE(EnumType, decltype(Val1 ^ Val2));
- ASSERT_SAME_TYPE(EnumType, decltype((~Val1)));
- ASSERT_SAME_TYPE(EnumType&, decltype(ValRef &= Val2));
- ASSERT_SAME_TYPE(EnumType&, decltype(ValRef |= Val2));
- ASSERT_SAME_TYPE(EnumType&, decltype(ValRef ^= Val2));
- }
-
- static_assert((Val1 & Zero) == Zero, "");
- static_assert((Val1 & Val1) == Val1, "");
- static_assert(dcast(Val1 & Val2) == (UVal1 & UVal2), "");
-
- static_assert((Val1 | Zero) == Val1, "");
- static_assert(dcast(Val1 | Val2) == (UVal1 | UVal2), "");
-
- static_assert((Val1 ^ Zero) == Val1, "");
- static_assert(dcast(Val1 ^ Val2) == (UVal1 ^ UVal2), "");
-
- static_assert(dcast(~Zero) == unpromote(~UZero), "");
- static_assert(dcast(~Val1) == unpromote(~UVal1), "");
-
- {
- EnumType e = Val1;
- EnumType& eref = (e &= Val2);
- assert(&eref == &e);
- assert(dcast(eref) == (UVal1 & UVal2));
- }
- {
- EnumType e = Val1;
- EnumType& eref = (e |= Val2);
- assert(&eref == &e);
- assert(dcast(eref) == (UVal1 | UVal2));
- }
- {
- EnumType e = Val1;
- EnumType& eref = (e ^= Val2);
- assert(&eref == &e);
- assert(dcast(eref) == (UVal1 ^ UVal2));
- }
- return true;
- }
-};
-
-#endif // TEST_BITMASK_TYPE
Modified: libcxx/trunk/test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp?rev=369597&r1=369596&r2=369597&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/filesystems/fs.enum/enum.copy_options.pass.cpp Wed Aug 21 15:38:38 2019
@@ -16,7 +16,7 @@
#include <type_traits>
#include <cassert>
-#include "check_bitmask_types.hpp"
+#include "check_bitmask_types.h"
#include "test_macros.h"
Modified: libcxx/trunk/test/std/input.output/filesystems/fs.enum/enum.directory_options.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/filesystems/fs.enum/enum.directory_options.pass.cpp?rev=369597&r1=369596&r2=369597&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/filesystems/fs.enum/enum.directory_options.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/filesystems/fs.enum/enum.directory_options.pass.cpp Wed Aug 21 15:38:38 2019
@@ -18,7 +18,7 @@
#include <sys/stat.h>
#include "test_macros.h"
-#include "check_bitmask_types.hpp"
+#include "check_bitmask_types.h"
constexpr fs::directory_options ME(int val) { return static_cast<fs::directory_options>(val); }
Modified: libcxx/trunk/test/std/input.output/filesystems/fs.enum/enum.perm_options.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/filesystems/fs.enum/enum.perm_options.pass.cpp?rev=369597&r1=369596&r2=369597&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/filesystems/fs.enum/enum.perm_options.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/filesystems/fs.enum/enum.perm_options.pass.cpp Wed Aug 21 15:38:38 2019
@@ -18,7 +18,7 @@
#include <sys/stat.h>
#include "test_macros.h"
-#include "check_bitmask_types.hpp"
+#include "check_bitmask_types.h"
constexpr fs::perm_options ME(int val) {
Modified: libcxx/trunk/test/std/input.output/filesystems/fs.enum/enum.perms.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/input.output/filesystems/fs.enum/enum.perms.pass.cpp?rev=369597&r1=369596&r2=369597&view=diff
==============================================================================
--- libcxx/trunk/test/std/input.output/filesystems/fs.enum/enum.perms.pass.cpp (original)
+++ libcxx/trunk/test/std/input.output/filesystems/fs.enum/enum.perms.pass.cpp Wed Aug 21 15:38:38 2019
@@ -18,7 +18,7 @@
#include <sys/stat.h>
#include "test_macros.h"
-#include "check_bitmask_types.hpp"
+#include "check_bitmask_types.h"
constexpr fs::perms ME(int val) { return static_cast<fs::perms>(val); }
Modified: libcxx/trunk/test/std/utilities/function.objects/comparisons/greater.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/function.objects/comparisons/greater.pass.cpp?rev=369597&r1=369596&r2=369597&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/function.objects/comparisons/greater.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/function.objects/comparisons/greater.pass.cpp Wed Aug 21 15:38:38 2019
@@ -15,7 +15,7 @@
#include <cassert>
#include "test_macros.h"
-#include "pointer_comparison_test_helper.hpp"
+#include "pointer_comparison_test_helper.h"
int main(int, char**)
{
Modified: libcxx/trunk/test/std/utilities/function.objects/comparisons/greater_equal.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/function.objects/comparisons/greater_equal.pass.cpp?rev=369597&r1=369596&r2=369597&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/function.objects/comparisons/greater_equal.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/function.objects/comparisons/greater_equal.pass.cpp Wed Aug 21 15:38:38 2019
@@ -15,7 +15,7 @@
#include <cassert>
#include "test_macros.h"
-#include "pointer_comparison_test_helper.hpp"
+#include "pointer_comparison_test_helper.h"
int main(int, char**)
{
Modified: libcxx/trunk/test/std/utilities/function.objects/comparisons/less.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/function.objects/comparisons/less.pass.cpp?rev=369597&r1=369596&r2=369597&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/function.objects/comparisons/less.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/function.objects/comparisons/less.pass.cpp Wed Aug 21 15:38:38 2019
@@ -15,7 +15,7 @@
#include <cassert>
#include "test_macros.h"
-#include "pointer_comparison_test_helper.hpp"
+#include "pointer_comparison_test_helper.h"
int main(int, char**)
{
Modified: libcxx/trunk/test/std/utilities/function.objects/comparisons/less_equal.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/function.objects/comparisons/less_equal.pass.cpp?rev=369597&r1=369596&r2=369597&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/function.objects/comparisons/less_equal.pass.cpp (original)
+++ libcxx/trunk/test/std/utilities/function.objects/comparisons/less_equal.pass.cpp Wed Aug 21 15:38:38 2019
@@ -15,7 +15,7 @@
#include <cassert>
#include "test_macros.h"
-#include "pointer_comparison_test_helper.hpp"
+#include "pointer_comparison_test_helper.h"
int main(int, char**)
{
Added: libcxx/trunk/test/std/utilities/function.objects/comparisons/pointer_comparison_test_helper.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/function.objects/comparisons/pointer_comparison_test_helper.h?rev=369597&view=auto
==============================================================================
--- libcxx/trunk/test/std/utilities/function.objects/comparisons/pointer_comparison_test_helper.h (added)
+++ libcxx/trunk/test/std/utilities/function.objects/comparisons/pointer_comparison_test_helper.h Wed Aug 21 15:38:38 2019
@@ -0,0 +1,39 @@
+#ifndef POINTER_COMPARISON_TEST_HELPER_H
+#define POINTER_COMPARISON_TEST_HELPER_H
+
+#include <vector>
+#include <memory>
+#include <cstdint>
+#include <cassert>
+
+#include "test_macros.h"
+
+template <class T, template<class> class CompareTemplate>
+void do_pointer_comparison_test() {
+ typedef CompareTemplate<T*> Compare;
+ typedef CompareTemplate<std::uintptr_t> UIntCompare;
+#if TEST_STD_VER > 11
+ typedef CompareTemplate<void> VoidCompare;
+#else
+ typedef Compare VoidCompare;
+#endif
+ std::vector<std::shared_ptr<T> > pointers;
+ const std::size_t test_size = 100;
+ for (size_t i=0; i < test_size; ++i)
+ pointers.push_back(std::shared_ptr<T>(new T()));
+ Compare comp;
+ UIntCompare ucomp;
+ VoidCompare vcomp;
+ for (size_t i=0; i < test_size; ++i) {
+ for (size_t j=0; j < test_size; ++j) {
+ T* lhs = pointers[i].get();
+ T* rhs = pointers[j].get();
+ std::uintptr_t lhs_uint = reinterpret_cast<std::uintptr_t>(lhs);
+ std::uintptr_t rhs_uint = reinterpret_cast<std::uintptr_t>(rhs);
+ assert(comp(lhs, rhs) == ucomp(lhs_uint, rhs_uint));
+ assert(vcomp(lhs, rhs) == ucomp(lhs_uint, rhs_uint));
+ }
+ }
+}
+
+#endif // POINTER_COMPARISON_TEST_HELPER_H
Removed: libcxx/trunk/test/std/utilities/function.objects/comparisons/pointer_comparison_test_helper.hpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/function.objects/comparisons/pointer_comparison_test_helper.hpp?rev=369596&view=auto
==============================================================================
--- libcxx/trunk/test/std/utilities/function.objects/comparisons/pointer_comparison_test_helper.hpp (original)
+++ libcxx/trunk/test/std/utilities/function.objects/comparisons/pointer_comparison_test_helper.hpp (removed)
@@ -1,39 +0,0 @@
-#ifndef POINTER_COMPARISON_TEST_HELPER_HPP
-#define POINTER_COMPARISON_TEST_HELPER_HPP
-
-#include <vector>
-#include <memory>
-#include <cstdint>
-#include <cassert>
-
-#include "test_macros.h"
-
-template <class T, template<class> class CompareTemplate>
-void do_pointer_comparison_test() {
- typedef CompareTemplate<T*> Compare;
- typedef CompareTemplate<std::uintptr_t> UIntCompare;
-#if TEST_STD_VER > 11
- typedef CompareTemplate<void> VoidCompare;
-#else
- typedef Compare VoidCompare;
-#endif
- std::vector<std::shared_ptr<T> > pointers;
- const std::size_t test_size = 100;
- for (size_t i=0; i < test_size; ++i)
- pointers.push_back(std::shared_ptr<T>(new T()));
- Compare comp;
- UIntCompare ucomp;
- VoidCompare vcomp;
- for (size_t i=0; i < test_size; ++i) {
- for (size_t j=0; j < test_size; ++j) {
- T* lhs = pointers[i].get();
- T* rhs = pointers[j].get();
- std::uintptr_t lhs_uint = reinterpret_cast<std::uintptr_t>(lhs);
- std::uintptr_t rhs_uint = reinterpret_cast<std::uintptr_t>(rhs);
- assert(comp(lhs, rhs) == ucomp(lhs_uint, rhs_uint));
- assert(vcomp(lhs, rhs) == ucomp(lhs_uint, rhs_uint));
- }
- }
-}
-
-#endif // POINTER_COMPARISON_TEST_HELPER_HPP
More information about the libcxx-commits
mailing list