From f7b43230b844373b421571467864a5fbf644e38d Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Tue, 19 Mar 2019 19:27:29 +0000 Subject: Revert "[libc++] Build support as part of the dylib" When I applied r356500 (https://reviews.llvm.org/D59152), I somehow deleted all of filesystem's tests. I will revert r356500 and re-apply it properly. llvm-svn: 356505 --- .../filesystems/fs.enum/enum.perm_options.pass.cpp | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 libcxx/test/std/input.output/filesystems/fs.enum/enum.perm_options.pass.cpp (limited to 'libcxx/test/std/input.output/filesystems/fs.enum/enum.perm_options.pass.cpp') diff --git a/libcxx/test/std/input.output/filesystems/fs.enum/enum.perm_options.pass.cpp b/libcxx/test/std/input.output/filesystems/fs.enum/enum.perm_options.pass.cpp new file mode 100644 index 00000000000..1fd353d041f --- /dev/null +++ b/libcxx/test/std/input.output/filesystems/fs.enum/enum.perm_options.pass.cpp @@ -0,0 +1,49 @@ +//===----------------------------------------------------------------------===// +// +// 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 + +// + +// enum class perm_options; + +#include "filesystem_include.hpp" +#include +#include +#include + +#include "test_macros.h" +#include "check_bitmask_types.hpp" + + +constexpr fs::perm_options ME(int val) { + return static_cast(val); +} + +int main(int, char**) { + typedef fs::perm_options E; + static_assert(std::is_enum::value, ""); + + // Check that E is a scoped enum by checking for conversions. + typedef std::underlying_type::type UT; + static_assert(!std::is_convertible::value, ""); + + static_assert(std::is_same::value, ""); // Implementation detail + + typedef check_bitmask_type BitmaskTester; + assert(BitmaskTester::check()); + + static_assert( + E::replace == ME(1) && + E::add == ME(2) && + E::remove == ME(4) && + E::nofollow == ME(8), + "Expected enumeration values do not match"); + + return 0; +} -- cgit v1.2.3