diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2019-07-23 04:20:19 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2019-07-23 04:20:19 +0000 |
| commit | 30f12a42474f5b8f0409f5aabd3c335fd415b926 (patch) | |
| tree | 0c7bf91eba01a681946e2b219f02832ad94a5b09 /libcxx/test/std/utilities | |
| parent | 57d17ec2e17b8100ecf592d961e85fa867e9af77 (diff) | |
| download | bcm5719-llvm-30f12a42474f5b8f0409f5aabd3c335fd415b926.tar.gz bcm5719-llvm-30f12a42474f5b8f0409f5aabd3c335fd415b926.zip | |
Implement most of P1612R1: Relocate endian. Moves the std::endian functionality from 'type-traits' to 'bit'. No other change. The reason that this is 'partial' is that P1621 also recommends a feature-test macro, but I don't have the value for that one yet. In a month or so, I'll add that
llvm-svn: 366776
Diffstat (limited to 'libcxx/test/std/utilities')
| -rw-r--r-- | libcxx/test/std/utilities/meta/meta.type.synop/endian.pass.cpp | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/libcxx/test/std/utilities/meta/meta.type.synop/endian.pass.cpp b/libcxx/test/std/utilities/meta/meta.type.synop/endian.pass.cpp deleted file mode 100644 index 52924b357b8..00000000000 --- a/libcxx/test/std/utilities/meta/meta.type.synop/endian.pass.cpp +++ /dev/null @@ -1,48 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 - -// enum class endian; - -#include <type_traits> -#include <cstring> -#include <cassert> -#include <cstdint> - -#include "test_macros.h" - -int main(int, char**) { - static_assert(std::is_enum<std::endian>::value, ""); - -// Check that E is a scoped enum by checking for conversions. - typedef std::underlying_type<std::endian>::type UT; - static_assert(!std::is_convertible<std::endian, UT>::value, ""); - -// test that the enumeration values exist - static_assert( std::endian::little == std::endian::little ); - static_assert( std::endian::big == std::endian::big ); - static_assert( std::endian::native == std::endian::native ); - static_assert( std::endian::little != std::endian::big ); - -// Technically not required, but true on all existing machines - static_assert( std::endian::native == std::endian::little || - std::endian::native == std::endian::big ); - -// Try to check at runtime - { - uint32_t i = 0x01020304; - char c[4]; - static_assert(sizeof(i) == sizeof(c)); - std::memcpy(c, &i, sizeof(c)); - - assert ((c[0] == 1) == (std::endian::native == std::endian::big)); - } - - return 0; -} |

