[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / language.support / support.dynamic / align_val_t.pass.cpp
blob678c5110cba40352f0b1198489e440e21d543df6
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // enum class align_val_t : size_t {}
11 // UNSUPPORTED: c++03, c++11, c++14
13 #include <new>
15 #include "test_macros.h"
17 int main(int, char**) {
19 static_assert(std::is_enum<std::align_val_t>::value, "");
20 static_assert(std::is_same<std::underlying_type<std::align_val_t>::type, std::size_t>::value, "");
21 static_assert(!std::is_constructible<std::align_val_t, std::size_t>::value, "");
22 static_assert(!std::is_constructible<std::size_t, std::align_val_t>::value, "");
25 constexpr auto a = std::align_val_t(0);
26 constexpr auto b = std::align_val_t(32);
27 constexpr auto c = std::align_val_t(-1);
28 static_assert(a != b, "");
29 static_assert(a == std::align_val_t(0), "");
30 static_assert(b == std::align_val_t(32), "");
31 static_assert(static_cast<std::size_t>(c) == (std::size_t)-1, "");
34 return 0;