min_max_pass.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is dual licensed under the MIT and the University of Illinois Open
  6. // Source Licenses. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. // Adaptation to Boost of the libcxx
  10. // Copyright 2010 Vicente J. Botet Escriba
  11. // Distributed under the Boost Software License, Version 1.0.
  12. // See http://www.boost.org/LICENSE_1_0.txt
  13. #include <boost/chrono/chrono.hpp>
  14. #include <boost/detail/lightweight_test.hpp>
  15. #if defined BOOST_NO_CXX11_NUMERIC_LIMITS || defined BOOST_NO_CXX11_CONSTEXPR
  16. #define BOOST_CONSTEXPR_ASSERT(C) BOOST_TEST(C)
  17. #else
  18. #include <boost/static_assert.hpp>
  19. #define BOOST_CONSTEXPR_ASSERT(C) BOOST_STATIC_ASSERT(C)
  20. #endif
  21. int main()
  22. {
  23. typedef boost::chrono::system_clock Clock;
  24. typedef boost::chrono::milliseconds Duration;
  25. typedef boost::chrono::time_point<Clock, Duration> TP;
  26. BOOST_CONSTEXPR_ASSERT((TP::min)() == TP((Duration::min)()));
  27. BOOST_CONSTEXPR_ASSERT((TP::max)() == TP((Duration::max)()));
  28. return boost::report_errors();
  29. }