[llvm-gsymutil] Disable test macho-gsym-merged-callsites-dsym (#119957)
[llvm-project.git] / libcxx / test / std / time / time.duration / time.duration.cons / default.pass.cpp
blobc598afa365109a950fe56ae51f9c6a3e09a851f5
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 // <chrono>
11 // duration
13 // duration() = default;
15 // Rep must be default initialized, not initialized with 0
17 #include <chrono>
18 #include <cassert>
20 #include "test_macros.h"
21 #include "../../rep.h"
23 template <class D>
24 void
25 test()
27 D d;
28 assert(d.count() == typename D::rep());
29 #if TEST_STD_VER >= 11
30 constexpr D d2 = D();
31 static_assert(d2.count() == typename D::rep(), "");
32 #endif
35 int main(int, char**)
37 test<std::chrono::duration<Rep> >();
39 return 0;