[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / time / time.hms / time.12 / is_pm.pass.cpp
blob7ce59dc8a1b170c745733bc58007795ae473633e
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 //===----------------------------------------------------------------------===//
8 // UNSUPPORTED: c++03, c++11, c++14, c++17
9 // <chrono>
11 // constexpr bool is_pm(const hours& h) noexcept;
12 // Returns: 12h <= h && h <= 23
14 #include <chrono>
15 #include <cassert>
16 #include <utility>
18 #include "test_macros.h"
20 int main(int, char**)
22 using hours = std::chrono::hours;
23 ASSERT_SAME_TYPE(bool, decltype(std::chrono::is_pm(std::declval<hours>())));
24 ASSERT_NOEXCEPT( std::chrono::is_pm(std::declval<hours>()));
26 static_assert(!std::chrono::is_pm(hours( 0)), "");
27 static_assert(!std::chrono::is_pm(hours(11)), "");
28 static_assert( std::chrono::is_pm(hours(12)), "");
29 static_assert( std::chrono::is_pm(hours(23)), "");
31 for (int i = 0; i < 12; ++i)
32 assert(!std::chrono::is_pm(hours(i)));
33 for (int i = 12; i < 24; ++i)
34 assert( std::chrono::is_pm(hours(i)));
36 return 0;