diff options
| author | Eric Fiselier <eric@efcs.ca> | 2014-12-20 01:40:03 +0000 |
|---|---|---|
| committer | Eric Fiselier <eric@efcs.ca> | 2014-12-20 01:40:03 +0000 |
| commit | 5a83710e371fe68a06e6e3876c6a2c8b820a8976 (patch) | |
| tree | afde4c82ad6704681781c5cd49baa3fbd05c85db /libcxx/test/utilities/time | |
| parent | f11e8eab527fba316c64112f6e05de1a79693a3e (diff) | |
| download | bcm5719-llvm-5a83710e371fe68a06e6e3876c6a2c8b820a8976.tar.gz bcm5719-llvm-5a83710e371fe68a06e6e3876c6a2c8b820a8976.zip | |
Move test into test/std subdirectory.
llvm-svn: 224658
Diffstat (limited to 'libcxx/test/utilities/time')
101 files changed, 0 insertions, 3593 deletions
diff --git a/libcxx/test/utilities/time/clock.h b/libcxx/test/utilities/time/clock.h deleted file mode 100644 index c72470c9cc8..00000000000 --- a/libcxx/test/utilities/time/clock.h +++ /dev/null @@ -1,26 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef CLOCK_H -#define CLOCK_H - -#include <chrono> - -class Clock -{ - typedef std::chrono::nanoseconds duration; - typedef duration::rep rep; - typedef duration::period period; - typedef std::chrono::time_point<Clock, duration> time_point; - static const bool is_steady = false; - - static time_point now(); -}; - -#endif // CLOCK_H diff --git a/libcxx/test/utilities/time/hours.pass.cpp b/libcxx/test/utilities/time/hours.pass.cpp deleted file mode 100644 index e4c39f7859e..00000000000 --- a/libcxx/test/utilities/time/hours.pass.cpp +++ /dev/null @@ -1,27 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// typedef duration<signed integral type of at least 23 bits, ratio<3600>> hours; - -#include <chrono> -#include <type_traits> -#include <limits> - -int main() -{ - typedef std::chrono::hours D; - typedef D::rep Rep; - typedef D::period Period; - static_assert(std::is_signed<Rep>::value, ""); - static_assert(std::is_integral<Rep>::value, ""); - static_assert(std::numeric_limits<Rep>::digits >= 22, ""); - static_assert((std::is_same<Period, std::ratio<3600> >::value), ""); -} diff --git a/libcxx/test/utilities/time/microseconds.pass.cpp b/libcxx/test/utilities/time/microseconds.pass.cpp deleted file mode 100644 index 1fe6b10da5a..00000000000 --- a/libcxx/test/utilities/time/microseconds.pass.cpp +++ /dev/null @@ -1,27 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// typedef duration<signed integral type of at least 55 bits, micro> microseconds; - -#include <chrono> -#include <type_traits> -#include <limits> - -int main() -{ - typedef std::chrono::microseconds D; - typedef D::rep Rep; - typedef D::period Period; - static_assert(std::is_signed<Rep>::value, ""); - static_assert(std::is_integral<Rep>::value, ""); - static_assert(std::numeric_limits<Rep>::digits >= 54, ""); - static_assert((std::is_same<Period, std::micro>::value), ""); -} diff --git a/libcxx/test/utilities/time/milliseconds.pass.cpp b/libcxx/test/utilities/time/milliseconds.pass.cpp deleted file mode 100644 index 75df301f7a6..00000000000 --- a/libcxx/test/utilities/time/milliseconds.pass.cpp +++ /dev/null @@ -1,27 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// typedef duration<signed integral type of at least 45 bits, milli> milliseconds; - -#include <chrono> -#include <type_traits> -#include <limits> - -int main() -{ - typedef std::chrono::milliseconds D; - typedef D::rep Rep; - typedef D::period Period; - static_assert(std::is_signed<Rep>::value, ""); - static_assert(std::is_integral<Rep>::value, ""); - static_assert(std::numeric_limits<Rep>::digits >= 44, ""); - static_assert((std::is_same<Period, std::milli>::value), ""); -} diff --git a/libcxx/test/utilities/time/minutes.pass.cpp b/libcxx/test/utilities/time/minutes.pass.cpp deleted file mode 100644 index 14214861c07..00000000000 --- a/libcxx/test/utilities/time/minutes.pass.cpp +++ /dev/null @@ -1,27 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// typedef duration<signed integral type of at least 29 bits, ratio< 60>> minutes; - -#include <chrono> -#include <type_traits> -#include <limits> - -int main() -{ - typedef std::chrono::minutes D; - typedef D::rep Rep; - typedef D::period Period; - static_assert(std::is_signed<Rep>::value, ""); - static_assert(std::is_integral<Rep>::value, ""); - static_assert(std::numeric_limits<Rep>::digits >= 28, ""); - static_assert((std::is_same<Period, std::ratio<60> >::value), ""); -} diff --git a/libcxx/test/utilities/time/nanoseconds.pass.cpp b/libcxx/test/utilities/time/nanoseconds.pass.cpp deleted file mode 100644 index d422803f452..00000000000 --- a/libcxx/test/utilities/time/nanoseconds.pass.cpp +++ /dev/null @@ -1,27 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// typedef duration<signed integral type of at least 64 bits, nano> nanoseconds; - -#include <chrono> -#include <type_traits> -#include <limits> - -int main() -{ - typedef std::chrono::nanoseconds D; - typedef D::rep Rep; - typedef D::period Period; - static_assert(std::is_signed<Rep>::value, ""); - static_assert(std::is_integral<Rep>::value, ""); - static_assert(std::numeric_limits<Rep>::digits >= 63, ""); - static_assert((std::is_same<Period, std::nano>::value), ""); -} diff --git a/libcxx/test/utilities/time/rep.h b/libcxx/test/utilities/time/rep.h deleted file mode 100644 index 2ec3514ab56..00000000000 --- a/libcxx/test/utilities/time/rep.h +++ /dev/null @@ -1,27 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef REP_H -#define REP_H - -class Rep -{ - int data_; -public: - _LIBCPP_CONSTEXPR Rep() : data_(-1) {} - explicit _LIBCPP_CONSTEXPR Rep(int i) : data_(i) {} - - bool _LIBCPP_CONSTEXPR operator==(int i) const {return data_ == i;} - bool _LIBCPP_CONSTEXPR operator==(const Rep& r) const {return data_ == r.data_;} - - Rep& operator*=(Rep x) {data_ *= x.data_; return *this;} - Rep& operator/=(Rep x) {data_ /= x.data_; return *this;} -}; - -#endif // REP_H diff --git a/libcxx/test/utilities/time/seconds.pass.cpp b/libcxx/test/utilities/time/seconds.pass.cpp deleted file mode 100644 index 231d59695a0..00000000000 --- a/libcxx/test/utilities/time/seconds.pass.cpp +++ /dev/null @@ -1,27 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// typedef duration<signed integral type of at least 35 bits > seconds; - -#include <chrono> -#include <type_traits> -#include <limits> - -int main() -{ - typedef std::chrono::seconds D; - typedef D::rep Rep; - typedef D::period Period; - static_assert(std::is_signed<Rep>::value, ""); - static_assert(std::is_integral<Rep>::value, ""); - static_assert(std::numeric_limits<Rep>::digits >= 34, ""); - static_assert((std::is_same<Period, std::ratio<1> >::value), ""); -} diff --git a/libcxx/test/utilities/time/time.clock.req/nothing_to_do.pass.cpp b/libcxx/test/utilities/time/time.clock.req/nothing_to_do.pass.cpp deleted file mode 100644 index b58f5c55b64..00000000000 --- a/libcxx/test/utilities/time/time.clock.req/nothing_to_do.pass.cpp +++ /dev/null @@ -1,12 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -int main() -{ -} diff --git a/libcxx/test/utilities/time/time.clock/nothing_to_do.pass.cpp b/libcxx/test/utilities/time/time.clock/nothing_to_do.pass.cpp deleted file mode 100644 index b58f5c55b64..00000000000 --- a/libcxx/test/utilities/time/time.clock/nothing_to_do.pass.cpp +++ /dev/null @@ -1,12 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -int main() -{ -} diff --git a/libcxx/test/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp b/libcxx/test/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp deleted file mode 100644 index 848534d6179..00000000000 --- a/libcxx/test/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp +++ /dev/null @@ -1,34 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This test uses new symbols that were not defined in the libc++ shipped on -// darwin11 and darwin12: -// XFAIL: with_system_lib=x86_64-apple-darwin11 -// XFAIL: with_system_lib=x86_64-apple-darwin12 - -// <chrono> - -// high_resolution_clock - -// check clock invariants - -#include <chrono> - -template <class _Tp> -void test(const _Tp &) {} - -int main() -{ - typedef std::chrono::high_resolution_clock C; - static_assert((std::is_same<C::rep, C::duration::rep>::value), ""); - static_assert((std::is_same<C::period, C::duration::period>::value), ""); - static_assert((std::is_same<C::duration, C::time_point::duration>::value), ""); - static_assert(C::is_steady || !C::is_steady, ""); - test(std::chrono::high_resolution_clock::is_steady); -} diff --git a/libcxx/test/utilities/time/time.clock/time.clock.hires/now.pass.cpp b/libcxx/test/utilities/time/time.clock/time.clock.hires/now.pass.cpp deleted file mode 100644 index 0bcd99d76ad..00000000000 --- a/libcxx/test/utilities/time/time.clock/time.clock.hires/now.pass.cpp +++ /dev/null @@ -1,22 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// high_resolution_clock - -// static time_point now(); - -#include <chrono> - -int main() -{ - typedef std::chrono::high_resolution_clock C; - C::time_point t1 = C::now(); -} diff --git a/libcxx/test/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp b/libcxx/test/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp deleted file mode 100644 index 60c646147ce..00000000000 --- a/libcxx/test/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp +++ /dev/null @@ -1,35 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This test uses new symbols that were not defined in the libc++ shipped on -// darwin11 and darwin12: -// XFAIL: with_system_lib=x86_64-apple-darwin11 -// XFAIL: with_system_lib=x86_64-apple-darwin12 -// UNSUPPORTED: libcpp-has-no-monotonic-clock - -// <chrono> - -// steady_clock - -// check clock invariants - -#include <chrono> - -template <class _Tp> -void test(const _Tp &) {} - -int main() -{ - typedef std::chrono::steady_clock C; - static_assert((std::is_same<C::rep, C::duration::rep>::value), ""); - static_assert((std::is_same<C::period, C::duration::period>::value), ""); - static_assert((std::is_same<C::duration, C::time_point::duration>::value), ""); - static_assert(C::is_steady, ""); - test(std::chrono::steady_clock::is_steady); -} diff --git a/libcxx/test/utilities/time/time.clock/time.clock.steady/now.pass.cpp b/libcxx/test/utilities/time/time.clock/time.clock.steady/now.pass.cpp deleted file mode 100644 index 4b86d9e8cbc..00000000000 --- a/libcxx/test/utilities/time/time.clock/time.clock.steady/now.pass.cpp +++ /dev/null @@ -1,27 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// UNSUPPORTED: libcpp-has-no-monotonic-clock - -// <chrono> - -// steady_clock - -// static time_point now(); - -#include <chrono> -#include <cassert> - -int main() -{ - typedef std::chrono::steady_clock C; - C::time_point t1 = C::now(); - C::time_point t2 = C::now(); - assert(t2 >= t1); -} diff --git a/libcxx/test/utilities/time/time.clock/time.clock.system/consistency.pass.cpp b/libcxx/test/utilities/time/time.clock/time.clock.system/consistency.pass.cpp deleted file mode 100644 index d9d6b04d631..00000000000 --- a/libcxx/test/utilities/time/time.clock/time.clock.system/consistency.pass.cpp +++ /dev/null @@ -1,35 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This test uses new symbols that were not defined in the libc++ shipped on -// darwin11 and darwin12: -// XFAIL: with_system_lib=x86_64-apple-darwin11 -// XFAIL: with_system_lib=x86_64-apple-darwin12 - -// <chrono> - -// system_clock - -// check clock invariants - -#include <chrono> - -template <class _Tp> -void test(const _Tp &) {} - -int main() -{ - typedef std::chrono::system_clock C; - static_assert((std::is_same<C::rep, C::duration::rep>::value), ""); - static_assert((std::is_same<C::period, C::duration::period>::value), ""); - static_assert((std::is_same<C::duration, C::time_point::duration>::value), ""); - static_assert((std::is_same<C::time_point::clock, C>::value), ""); - static_assert((C::is_steady || !C::is_steady), ""); - test(std::chrono::system_clock::is_steady); -} diff --git a/libcxx/test/utilities/time/time.clock/time.clock.system/from_time_t.pass.cpp b/libcxx/test/utilities/time/time.clock/time.clock.system/from_time_t.pass.cpp deleted file mode 100644 index 9b12a667ffd..00000000000 --- a/libcxx/test/utilities/time/time.clock/time.clock.system/from_time_t.pass.cpp +++ /dev/null @@ -1,23 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// system_clock - -// static time_point from_time_t(time_t t); - -#include <chrono> -#include <ctime> - -int main() -{ - typedef std::chrono::system_clock C; - C::time_point t1 = C::from_time_t(C::to_time_t(C::now())); -} diff --git a/libcxx/test/utilities/time/time.clock/time.clock.system/now.pass.cpp b/libcxx/test/utilities/time/time.clock/time.clock.system/now.pass.cpp deleted file mode 100644 index 60530fdf3a9..00000000000 --- a/libcxx/test/utilities/time/time.clock/time.clock.system/now.pass.cpp +++ /dev/null @@ -1,22 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// system_clock - -// static time_point now(); - -#include <chrono> - -int main() -{ - typedef std::chrono::system_clock C; - C::time_point t1 = C::now(); -} diff --git a/libcxx/test/utilities/time/time.clock/time.clock.system/rep_signed.pass.cpp b/libcxx/test/utilities/time/time.clock/time.clock.system/rep_signed.pass.cpp deleted file mode 100644 index b6a440e16dd..00000000000 --- a/libcxx/test/utilities/time/time.clock/time.clock.system/rep_signed.pass.cpp +++ /dev/null @@ -1,23 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// system_clock - -// rep should be signed - -#include <chrono> -#include <cassert> - -int main() -{ - assert(std::chrono::system_clock::duration::min() < - std::chrono::system_clock::duration::zero()); -} diff --git a/libcxx/test/utilities/time/time.clock/time.clock.system/to_time_t.pass.cpp b/libcxx/test/utilities/time/time.clock/time.clock.system/to_time_t.pass.cpp deleted file mode 100644 index 2a82d5375e1..00000000000 --- a/libcxx/test/utilities/time/time.clock/time.clock.system/to_time_t.pass.cpp +++ /dev/null @@ -1,23 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// system_clock - -// time_t to_time_t(const time_point& t); - -#include <chrono> -#include <ctime> - -int main() -{ - typedef std::chrono::system_clock C; - std::time_t t1 = C::to_time_t(C::now()); -} diff --git a/libcxx/test/utilities/time/time.duration/default_ratio.pass.cpp b/libcxx/test/utilities/time/time.duration/default_ratio.pass.cpp deleted file mode 100644 index a34e27832bd..00000000000 --- a/libcxx/test/utilities/time/time.duration/default_ratio.pass.cpp +++ /dev/null @@ -1,26 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// Test default template arg: - -// template <class Rep, class Period = ratio<1>> -// class duration; - -#include <chrono> -#include <type_traits> - -int main() -{ - static_assert((std::is_same<std::chrono::duration<int, std::ratio<1> >, - std::chrono::duration<int> >::value), ""); -} diff --git a/libcxx/test/utilities/time/time.duration/duration.fail.cpp b/libcxx/test/utilities/time/time.duration/duration.fail.cpp deleted file mode 100644 index 053616b79b4..00000000000 --- a/libcxx/test/utilities/time/time.duration/duration.fail.cpp +++ /dev/null @@ -1,23 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// If a program instantiates duration with a duration type for the template -// argument Rep a diagnostic is required. - -#include <chrono> - -int main() -{ - typedef std::chrono::duration<std::chrono::milliseconds> D; - D d; -} diff --git a/libcxx/test/utilities/time/time.duration/positive_num.fail.cpp b/libcxx/test/utilities/time/time.duration/positive_num.fail.cpp deleted file mode 100644 index e9096fd3fcb..00000000000 --- a/libcxx/test/utilities/time/time.duration/positive_num.fail.cpp +++ /dev/null @@ -1,22 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// Period::num shall be positive, diagnostic required. - -#include <chrono> - -int main() -{ - typedef std::chrono::duration<int, std::ratio<5, -1> > D; - D d; -} diff --git a/libcxx/test/utilities/time/time.duration/ratio.fail.cpp b/libcxx/test/utilities/time/time.duration/ratio.fail.cpp deleted file mode 100644 index 4ce0aaad003..00000000000 --- a/libcxx/test/utilities/time/time.duration/ratio.fail.cpp +++ /dev/null @@ -1,30 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// Period shall be a specialization of ratio, diagnostic required. - -#include <chrono> - -template <int N, int D = 1> -class Ratio -{ -public: - static const int num = N; - static const int den = D; -}; - -int main() -{ - typedef std::chrono::duration<int, Ratio<1> > D; - D d; -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_++.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_++.pass.cpp deleted file mode 100644 index 8a8f4b1c0d9..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_++.pass.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// duration& operator++(); - -#include <chrono> -#include <cassert> - -int main() -{ - std::chrono::hours h(3); - std::chrono::hours& href = ++h; - assert(&href == &h); - assert(h.count() == 4); -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_++int.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_++int.pass.cpp deleted file mode 100644 index cf502828100..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_++int.pass.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// duration operator++(int); - -#include <chrono> -#include <cassert> - -int main() -{ - std::chrono::hours h(3); - std::chrono::hours h2 = h++; - assert(h.count() == 4); - assert(h2.count() == 3); -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_+.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_+.pass.cpp deleted file mode 100644 index c0f10147ee8..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_+.pass.cpp +++ /dev/null @@ -1,33 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// duration operator+() const; - -#include <chrono> -#include <cassert> - -int main() -{ - { - const std::chrono::minutes m(3); - std::chrono::minutes m2 = +m; - assert(m.count() == m2.count()); - } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - { - constexpr std::chrono::minutes m(3); - constexpr std::chrono::minutes m2 = +m; - static_assert(m.count() == m2.count(), ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_+=.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_+=.pass.cpp deleted file mode 100644 index 8d8cf4539c1..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_+=.pass.cpp +++ /dev/null @@ -1,26 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// duration& operator+=(const duration& d); - -#include <chrono> -#include <cassert> - -int main() -{ - std::chrono::seconds s(3); - s += std::chrono::seconds(2); - assert(s.count() == 5); - s += std::chrono::minutes(2); - assert(s.count() == 125); -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_--.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_--.pass.cpp deleted file mode 100644 index 0aadfbcd599..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_--.pass.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// duration& operator--(); - -#include <chrono> -#include <cassert> - -int main() -{ - std::chrono::hours h(3); - std::chrono::hours& href = --h; - assert(&href == &h); - assert(h.count() == 2); -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_--int.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_--int.pass.cpp deleted file mode 100644 index 7fc6a1df603..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_--int.pass.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// duration operator--(int); - -#include <chrono> -#include <cassert> - -int main() -{ - std::chrono::hours h(3); - std::chrono::hours h2 = h--; - assert(h.count() == 2); - assert(h2.count() == 3); -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_-.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_-.pass.cpp deleted file mode 100644 index 00da6f69ca5..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_-.pass.cpp +++ /dev/null @@ -1,33 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// duration operator-() const; - -#include <chrono> -#include <cassert> - -int main() -{ - { - const std::chrono::minutes m(3); - std::chrono::minutes m2 = -m; - assert(m2.count() == -m.count()); - } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - { - constexpr std::chrono::minutes m(3); - constexpr std::chrono::minutes m2 = -m; - static_assert(m2.count() == -m.count(), ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_-=.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_-=.pass.cpp deleted file mode 100644 index a0a7aed202b..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_-=.pass.cpp +++ /dev/null @@ -1,26 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// duration& operator-=(const duration& d); - -#include <chrono> -#include <cassert> - -int main() -{ - std::chrono::seconds s(3); - s -= std::chrono::seconds(2); - assert(s.count() == 1); - s -= std::chrono::minutes(2); - assert(s.count() == -119); -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_divide=.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_divide=.pass.cpp deleted file mode 100644 index 09786bcd8cf..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_divide=.pass.cpp +++ /dev/null @@ -1,24 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// duration& operator/=(const rep& rhs); - -#include <chrono> -#include <cassert> - -int main() -{ - std::chrono::nanoseconds ns(15); - ns /= 5; - assert(ns.count() == 3); -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_mod=duration.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_mod=duration.pass.cpp deleted file mode 100644 index 8a4a2b47232..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_mod=duration.pass.cpp +++ /dev/null @@ -1,27 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// duration& operator%=(const duration& rhs) - -#include <chrono> -#include <cassert> - -int main() -{ - std::chrono::microseconds us(11); - std::chrono::microseconds us2(3); - us %= us2; - assert(us.count() == 2); - us %= std::chrono::milliseconds(3); - assert(us.count() == 2); -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_mod=rep.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_mod=rep.pass.cpp deleted file mode 100644 index 8758e17ba6a..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_mod=rep.pass.cpp +++ /dev/null @@ -1,24 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// duration& operator%=(const rep& rhs) - -#include <chrono> -#include <cassert> - -int main() -{ - std::chrono::microseconds us(11); - us %= 3; - assert(us.count() == 2); -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_times=.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_times=.pass.cpp deleted file mode 100644 index b97534a3615..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.arithmetic/op_times=.pass.cpp +++ /dev/null @@ -1,24 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// duration& operator*=(const rep& rhs); - -#include <chrono> -#include <cassert> - -int main() -{ - std::chrono::nanoseconds ns(3); - ns *= 5; - assert(ns.count() == 15); -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cast/duration_cast.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cast/duration_cast.pass.cpp deleted file mode 100644 index 1c87fcd909e..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.cast/duration_cast.pass.cpp +++ /dev/null @@ -1,52 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class ToDuration, class Rep, class Period> -// constexpr -// ToDuration -// duration_cast(const duration<Rep, Period>& d); - -#include <chrono> -#include <type_traits> -#include <cassert> - -template <class ToDuration, class FromDuration> -void -test(const FromDuration& f, const ToDuration& d) -{ - { - typedef decltype(std::chrono::duration_cast<ToDuration>(f)) R; - static_assert((std::is_same<R, ToDuration>::value), ""); - assert(std::chrono::duration_cast<ToDuration>(f) == d); - } -} - -int main() -{ - test(std::chrono::milliseconds(7265000), std::chrono::hours(2)); - test(std::chrono::milliseconds(7265000), std::chrono::minutes(121)); - test(std::chrono::milliseconds(7265000), std::chrono::seconds(7265)); - test(std::chrono::milliseconds(7265000), std::chrono::milliseconds(7265000)); - test(std::chrono::milliseconds(7265000), std::chrono::microseconds(7265000000LL)); - test(std::chrono::milliseconds(7265000), std::chrono::nanoseconds(7265000000000LL)); - test(std::chrono::milliseconds(7265000), - std::chrono::duration<double, std::ratio<3600> >(7265./3600)); - test(std::chrono::duration<int, std::ratio<2, 3> >(9), - std::chrono::duration<int, std::ratio<3, 5> >(10)); -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - { - constexpr std::chrono::hours h = std::chrono::duration_cast<std::chrono::hours>(std::chrono::milliseconds(7265000)); - static_assert(h.count() == 2, ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cast/toduration.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cast/toduration.fail.cpp deleted file mode 100644 index 13dd8f44c36..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.cast/toduration.fail.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class ToDuration, class Rep, class Period> -// ToDuration -// duration_cast(const duration<Rep, Period>& d); - -// ToDuration shall be an instantiation of duration. - -#include <chrono> - -int main() -{ - std::chrono::duration_cast<int>(std::chrono::milliseconds(3)); -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.comparisons/op_equal.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.comparisons/op_equal.pass.cpp deleted file mode 100644 index 2d0dd94d4cf..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.comparisons/op_equal.pass.cpp +++ /dev/null @@ -1,115 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep1, class Period1, class Rep2, class Period2> -// constexpr -// bool -// operator==(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); - -// template <class Rep1, class Period1, class Rep2, class Period2> -// constexpr -// bool -// operator!=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); - -#include <chrono> -#include <cassert> - -int main() -{ - { - std::chrono::seconds s1(3); - std::chrono::seconds s2(3); - assert(s1 == s2); - assert(!(s1 != s2)); - } - { - std::chrono::seconds s1(3); - std::chrono::seconds s2(4); - assert(!(s1 == s2)); - assert(s1 != s2); - } - { - std::chrono::milliseconds s1(3); - std::chrono::microseconds s2(3000); - assert(s1 == s2); - assert(!(s1 != s2)); - } - { - std::chrono::milliseconds s1(3); - std::chrono::microseconds s2(4000); - assert(!(s1 == s2)); - assert(s1 != s2); - } - { - std::chrono::duration<int, std::ratio<2, 3> > s1(9); - std::chrono::duration<int, std::ratio<3, 5> > s2(10); - assert(s1 == s2); - assert(!(s1 != s2)); - } - { - std::chrono::duration<int, std::ratio<2, 3> > s1(10); - std::chrono::duration<int, std::ratio<3, 5> > s2(9); - assert(!(s1 == s2)); - assert(s1 != s2); - } - { - std::chrono::duration<int, std::ratio<2, 3> > s1(9); - std::chrono::duration<double, std::ratio<3, 5> > s2(10); - assert(s1 == s2); - assert(!(s1 != s2)); - } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - { - constexpr std::chrono::seconds s1(3); - constexpr std::chrono::seconds s2(3); - static_assert(s1 == s2, ""); - static_assert(!(s1 != s2), ""); - } - { - constexpr std::chrono::seconds s1(3); - constexpr std::chrono::seconds s2(4); - static_assert(!(s1 == s2), ""); - static_assert(s1 != s2, ""); - } - { - constexpr std::chrono::milliseconds s1(3); - constexpr std::chrono::microseconds s2(3000); - static_assert(s1 == s2, ""); - static_assert(!(s1 != s2), ""); - } - { - constexpr std::chrono::milliseconds s1(3); - constexpr std::chrono::microseconds s2(4000); - static_assert(!(s1 == s2), ""); - static_assert(s1 != s2, ""); - } - { - constexpr std::chrono::duration<int, std::ratio<2, 3> > s1(9); - constexpr std::chrono::duration<int, std::ratio<3, 5> > s2(10); - static_assert(s1 == s2, ""); - static_assert(!(s1 != s2), ""); - } - { - constexpr std::chrono::duration<int, std::ratio<2, 3> > s1(10); - constexpr std::chrono::duration<int, std::ratio<3, 5> > s2(9); - static_assert(!(s1 == s2), ""); - static_assert(s1 != s2, ""); - } - { - constexpr std::chrono::duration<int, std::ratio<2, 3> > s1(9); - constexpr std::chrono::duration<double, std::ratio<3, 5> > s2(10); - static_assert(s1 == s2, ""); - static_assert(!(s1 != s2), ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.comparisons/op_less.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.comparisons/op_less.pass.cpp deleted file mode 100644 index 9d875579f32..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.comparisons/op_less.pass.cpp +++ /dev/null @@ -1,153 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep1, class Period1, class Rep2, class Period2> -// constexpr -// bool -// operator< (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); - -// template <class Rep1, class Period1, class Rep2, class Period2> -// constexpr -// bool -// operator> (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); - -// template <class Rep1, class Period1, class Rep2, class Period2> -// constexpr -// bool -// operator<=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); - -// template <class Rep1, class Period1, class Rep2, class Period2> -// constexpr -// bool -// operator>=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); - -#include <chrono> -#include <cassert> - -int main() -{ - { - std::chrono::seconds s1(3); - std::chrono::seconds s2(3); - assert(!(s1 < s2)); - assert(!(s1 > s2)); - assert( (s1 <= s2)); - assert( (s1 >= s2)); - } - { - std::chrono::seconds s1(3); - std::chrono::seconds s2(4); - assert( (s1 < s2)); - assert(!(s1 > s2)); - assert( (s1 <= s2)); - assert(!(s1 >= s2)); - } - { - std::chrono::milliseconds s1(3); - std::chrono::microseconds s2(3000); - assert(!(s1 < s2)); - assert(!(s1 > s2)); - assert( (s1 <= s2)); - assert( (s1 >= s2)); - } - { - std::chrono::milliseconds s1(3); - std::chrono::microseconds s2(4000); - assert( (s1 < s2)); - assert(!(s1 > s2)); - assert( (s1 <= s2)); - assert(!(s1 >= s2)); - } - { - std::chrono::duration<int, std::ratio<2, 3> > s1(9); - std::chrono::duration<int, std::ratio<3, 5> > s2(10); - assert(!(s1 < s2)); - assert(!(s1 > s2)); - assert( (s1 <= s2)); - assert( (s1 >= s2)); - } - { - std::chrono::duration<int, std::ratio<2, 3> > s1(10); - std::chrono::duration<int, std::ratio<3, 5> > s2(9); - assert(!(s1 < s2)); - assert( (s1 > s2)); - assert(!(s1 <= s2)); - assert( (s1 >= s2)); - } - { - std::chrono::duration<int, std::ratio<2, 3> > s1(9); - std::chrono::duration<double, std::ratio<3, 5> > s2(10); - assert(!(s1 < s2)); - assert(!(s1 > s2)); - assert( (s1 <= s2)); - assert( (s1 >= s2)); - } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - { - constexpr std::chrono::seconds s1(3); - constexpr std::chrono::seconds s2(3); - static_assert(!(s1 < s2), ""); - static_assert(!(s1 > s2), ""); - static_assert( (s1 <= s2), ""); - static_assert( (s1 >= s2), ""); - } - { - constexpr std::chrono::seconds s1(3); - constexpr std::chrono::seconds s2(4); - static_assert( (s1 < s2), ""); - static_assert(!(s1 > s2), ""); - static_assert( (s1 <= s2), ""); - static_assert(!(s1 >= s2), ""); - } - { - constexpr std::chrono::milliseconds s1(3); - constexpr std::chrono::microseconds s2(3000); - static_assert(!(s1 < s2), ""); - static_assert(!(s1 > s2), ""); - static_assert( (s1 <= s2), ""); - static_assert( (s1 >= s2), ""); - } - { - constexpr std::chrono::milliseconds s1(3); - constexpr std::chrono::microseconds s2(4000); - static_assert( (s1 < s2), ""); - static_assert(!(s1 > s2), ""); - static_assert( (s1 <= s2), ""); - static_assert(!(s1 >= s2), ""); - } - { - constexpr std::chrono::duration<int, std::ratio<2, 3> > s1(9); - constexpr std::chrono::duration<int, std::ratio<3, 5> > s2(10); - static_assert(!(s1 < s2), ""); - static_assert(!(s1 > s2), ""); - static_assert( (s1 <= s2), ""); - static_assert( (s1 >= s2), ""); - } - { - constexpr std::chrono::duration<int, std::ratio<2, 3> > s1(10); - constexpr std::chrono::duration<int, std::ratio<3, 5> > s2(9); - static_assert(!(s1 < s2), ""); - static_assert( (s1 > s2), ""); - static_assert(!(s1 <= s2), ""); - static_assert( (s1 >= s2), ""); - } - { - constexpr std::chrono::duration<int, std::ratio<2, 3> > s1(9); - constexpr std::chrono::duration<double, std::ratio<3, 5> > s2(10); - static_assert(!(s1 < s2), ""); - static_assert(!(s1 > s2), ""); - static_assert( (s1 <= s2), ""); - static_assert( (s1 >= s2), ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_exact.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_exact.pass.cpp deleted file mode 100644 index 152227d82a8..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_exact.pass.cpp +++ /dev/null @@ -1,36 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep2, class Period2> -// duration(const duration<Rep2, Period2>& d); - -// exact conversions allowed for integral reps - -#include <chrono> -#include <cassert> - -int main() -{ - { - std::chrono::milliseconds ms(1); - std::chrono::microseconds us = ms; - assert(us.count() == 1000); - } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - { - constexpr std::chrono::milliseconds ms(1); - constexpr std::chrono::microseconds us = ms; - static_assert(us.count() == 1000, ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_float_to_int.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_float_to_int.fail.cpp deleted file mode 100644 index 04c08257828..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_float_to_int.fail.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep2, class Period2> -// duration(const duration<Rep2, Period2>& d); - -// conversions from floating point to integral durations disallowed - -#include <chrono> - -int main() -{ - std::chrono::duration<double> d; - std::chrono::duration<int> i = d; -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_inexact.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_inexact.fail.cpp deleted file mode 100644 index e82e25e8f69..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_inexact.fail.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep2, class Period2> -// duration(const duration<Rep2, Period2>& d); - -// inexact conversions disallowed for integral reps - -#include <chrono> - -int main() -{ - std::chrono::microseconds us(1); - std::chrono::milliseconds ms = us; -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_inexact.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_inexact.pass.cpp deleted file mode 100644 index 519b2b141c2..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_inexact.pass.cpp +++ /dev/null @@ -1,36 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep2, class Period2> -// duration(const duration<Rep2, Period2>& d); - -// inexact conversions allowed for floating point reps - -#include <chrono> -#include <cassert> - -int main() -{ - { - std::chrono::duration<double, std::micro> us(1); - std::chrono::duration<double, std::milli> ms = us; - assert(ms.count() == 1./1000); - } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - { - constexpr std::chrono::duration<double, std::micro> us(1); - constexpr std::chrono::duration<double, std::milli> ms = us; - static_assert(ms.count() == 1./1000, ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_int_to_float.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_int_to_float.pass.cpp deleted file mode 100644 index 59fefe2e002..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_int_to_float.pass.cpp +++ /dev/null @@ -1,36 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep2, class Period2> -// duration(const duration<Rep2, Period2>& d); - -// conversions from integral to floating point durations allowed - -#include <chrono> -#include <cassert> - -int main() -{ - { - std::chrono::duration<int> i(3); - std::chrono::duration<double, std::milli> d = i; - assert(d.count() == 3000); - } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - { - constexpr std::chrono::duration<int> i(3); - constexpr std::chrono::duration<double, std::milli> d = i; - static_assert(d.count() == 3000, ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_overflow.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_overflow.pass.cpp deleted file mode 100644 index 74b65d6b9cc..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/convert_overflow.pass.cpp +++ /dev/null @@ -1,37 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep2, class Period2> -// duration(const duration<Rep2, Period2>& d); - -// overflow should SFINAE instead of error out, LWG 2094 - -#include <chrono> -#include <cassert> - -bool called = false; - -void f(std::chrono::milliseconds); -void f(std::chrono::seconds) -{ - called = true; -} - -int main() -{ - { - std::chrono::duration<int, std::exa> r(1); - f(r); - assert(called); - } -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/default.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/default.pass.cpp deleted file mode 100644 index c52990961c2..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/default.pass.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// duration() = default; - -// Rep must be default initialized, not initialized with 0 - -#include <chrono> -#include <cassert> - -#include "../../rep.h" - -template <class D> -void -test() -{ - D d; - assert(d.count() == typename D::rep()); -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - constexpr D d2 = D(); - static_assert(d2.count() == typename D::rep(), ""); -#endif -} - -int main() -{ - test<std::chrono::duration<Rep> >(); -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/rep.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/rep.pass.cpp deleted file mode 100644 index 20f81619bd1..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/rep.pass.cpp +++ /dev/null @@ -1,40 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep2> -// explicit duration(const Rep2& r); - -#include <chrono> -#include <cassert> - -#include "../../rep.h" - -template <class D, class R> -void -test(R r) -{ - D d(r); - assert(d.count() == r); -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - constexpr D d2(R(2)); - static_assert(d2.count() == 2, ""); -#endif -} - -int main() -{ - test<std::chrono::duration<int> >(5); - test<std::chrono::duration<int, std::ratio<3, 2> > >(5); - test<std::chrono::duration<Rep, std::ratio<3, 2> > >(Rep(3)); - test<std::chrono::duration<double, std::ratio<2, 3> > >(5.5); -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/rep01.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/rep01.fail.cpp deleted file mode 100644 index 9f071ca1afc..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/rep01.fail.cpp +++ /dev/null @@ -1,26 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep2> -// explicit duration(const Rep2& r); - -// test for explicit - -#include <chrono> - -#include "../../rep.h" - -int main() -{ - std::chrono::duration<int> d = 1; -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/rep02.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/rep02.fail.cpp deleted file mode 100644 index 37f32e77686..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/rep02.fail.cpp +++ /dev/null @@ -1,26 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep2> -// explicit duration(const Rep2& r); - -// Rep2 shall be implicitly convertible to rep - -#include <chrono> - -#include "../../rep.h" - -int main() -{ - std::chrono::duration<Rep> d(1); -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/rep02.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/rep02.pass.cpp deleted file mode 100644 index b3ba9f7081e..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/rep02.pass.cpp +++ /dev/null @@ -1,30 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep2> -// explicit duration(const Rep2& r); - -// construct double with int - -#include <chrono> -#include <cassert> - -int main() -{ - std::chrono::duration<double> d(5); - assert(d.count() == 5); -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - constexpr std::chrono::duration<double> d2(5); - static_assert(d2.count() == 5, ""); -#endif -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.cons/rep03.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.cons/rep03.fail.cpp deleted file mode 100644 index 4ace54b231f..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.cons/rep03.fail.cpp +++ /dev/null @@ -1,24 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep2> -// explicit duration(const Rep2& r); - -// treat_as_floating_point<Rep2>::value shall be false - -#include <chrono> - -int main() -{ - std::chrono::duration<int> d(1.); -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.literals/literals.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.literals/literals.pass.cpp deleted file mode 100644 index 48324ae8365..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.literals/literals.pass.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -#include <chrono> -#include <type_traits> -#include <cassert> - -int main() -{ -#if _LIBCPP_STD_VER > 11 - using namespace std::literals::chrono_literals; - -// Make sure the types are right - static_assert ( std::is_same<decltype( 3h ), std::chrono::hours>::value, "" ); - static_assert ( std::is_same<decltype( 3min ), std::chrono::minutes>::value, "" ); - static_assert ( std::is_same<decltype( 3s ), std::chrono::seconds>::value, "" ); - static_assert ( std::is_same<decltype( 3ms ), std::chrono::milliseconds>::value, "" ); - static_assert ( std::is_same<decltype( 3us ), std::chrono::microseconds>::value, "" ); - static_assert ( std::is_same<decltype( 3ns ), std::chrono::nanoseconds>::value, "" ); - - std::chrono::hours h = 4h; - assert ( h == std::chrono::hours(4)); - auto h2 = 4.0h; - assert ( h == h2 ); - - std::chrono::minutes min = 36min; - assert ( min == std::chrono::minutes(36)); - auto min2 = 36.0min; - assert ( min == min2 ); - - std::chrono::seconds s = 24s; - assert ( s == std::chrono::seconds(24)); - auto s2 = 24.0s; - assert ( s == s2 ); - - std::chrono::milliseconds ms = 247ms; - assert ( ms == std::chrono::milliseconds(247)); - auto ms2 = 247.0ms; - assert ( ms == ms2 ); - - std::chrono::microseconds us = 867us; - assert ( us == std::chrono::microseconds(867)); - auto us2 = 867.0us; - assert ( us == us2 ); - - std::chrono::nanoseconds ns = 645ns; - assert ( ns == std::chrono::nanoseconds(645)); - auto ns2 = 645.ns; - assert ( ns == ns2 ); -#endif -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.literals/literals1.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.literals/literals1.fail.cpp deleted file mode 100644 index 46aaa30e51e..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.literals/literals1.fail.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -#include <chrono> -#include <cassert> - -int main() -{ -#if _LIBCPP_STD_VER > 11 - std::chrono::hours h = 4h; // should fail w/conversion operator not found -#else -#error -#endif -} - diff --git a/libcxx/test/utilities/time/time.duration/time.duration.literals/literals1.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.literals/literals1.pass.cpp deleted file mode 100644 index 574f9bcce87..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.literals/literals1.pass.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -#include <chrono> -#include <cassert> - -int main() -{ -#if _LIBCPP_STD_VER > 11 - using namespace std::chrono; - - hours h = 4h; - assert ( h == hours(4)); - auto h2 = 4.0h; - assert ( h == h2 ); - - minutes min = 36min; - assert ( min == minutes(36)); - auto min2 = 36.0min; - assert ( min == min2 ); - - seconds s = 24s; - assert ( s == seconds(24)); - auto s2 = 24.0s; - assert ( s == s2 ); - - milliseconds ms = 247ms; - assert ( ms == milliseconds(247)); - auto ms2 = 247.0ms; - assert ( ms == ms2 ); - - microseconds us = 867us; - assert ( us == microseconds(867)); - auto us2 = 867.0us; - assert ( us == us2 ); - - nanoseconds ns = 645ns; - assert ( ns == nanoseconds(645)); - auto ns2 = 645.ns; - assert ( ns == ns2 ); -#endif -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.literals/literals2.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.literals/literals2.fail.cpp deleted file mode 100644 index 17358e589f4..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.literals/literals2.fail.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -#include <chrono> -#include <cassert> - -int main() -{ -#if _LIBCPP_STD_VER > 11 - using std::chrono::hours; - - hours foo = 4h; // should fail w/conversion operator not found -#else -#error -#endif -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.literals/literals2.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.literals/literals2.pass.cpp deleted file mode 100644 index e37bc6e6796..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.literals/literals2.pass.cpp +++ /dev/null @@ -1,51 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -#include <chrono> -#include <type_traits> -#include <cassert> - -int main() -{ -#if _LIBCPP_STD_VER > 11 - using namespace std::literals; - - std::chrono::hours h = 4h; - assert ( h == std::chrono::hours(4)); - auto h2 = 4.0h; - assert ( h == h2 ); - - std::chrono::minutes min = 36min; - assert ( min == std::chrono::minutes(36)); - auto min2 = 36.0min; - assert ( min == min2 ); - - std::chrono::seconds s = 24s; - assert ( s == std::chrono::seconds(24)); - auto s2 = 24.0s; - assert ( s == s2 ); - - std::chrono::milliseconds ms = 247ms; - assert ( ms == std::chrono::milliseconds(247)); - auto ms2 = 247.0ms; - assert ( ms == ms2 ); - - std::chrono::microseconds us = 867us; - assert ( us == std::chrono::microseconds(867)); - auto us2 = 867.0us; - assert ( us == us2 ); - - std::chrono::nanoseconds ns = 645ns; - assert ( ns == std::chrono::nanoseconds(645)); - auto ns2 = 645.ns; - assert ( ns == ns2 ); -#endif -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_+.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_+.pass.cpp deleted file mode 100644 index 6585351cb4c..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_+.pass.cpp +++ /dev/null @@ -1,73 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep1, class Period1, class Rep2, class Period2> -// typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2>>::type -// operator+(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); - -#include <chrono> -#include <cassert> - -int main() -{ - { - std::chrono::seconds s1(3); - std::chrono::seconds s2(5); - std::chrono::seconds r = s1 + s2; - assert(r.count() == 8); - } - { - std::chrono::seconds s1(3); - std::chrono::microseconds s2(5); - std::chrono::microseconds r = s1 + s2; - assert(r.count() == 3000005); - } - { - std::chrono::duration<int, std::ratio<2, 3> > s1(3); - std::chrono::duration<int, std::ratio<3, 5> > s2(5); - std::chrono::duration<int, std::ratio<1, 15> > r = s1 + s2; - assert(r.count() == 75); - } - { - std::chrono::duration<int, std::ratio<2, 3> > s1(3); - std::chrono::duration<double, std::ratio<3, 5> > s2(5); - std::chrono::duration<double, std::ratio<1, 15> > r = s1 + s2; - assert(r.count() == 75); - } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - { - constexpr std::chrono::seconds s1(3); - constexpr std::chrono::seconds s2(5); - constexpr std::chrono::seconds r = s1 + s2; - static_assert(r.count() == 8, ""); - } - { - constexpr std::chrono::seconds s1(3); - constexpr std::chrono::microseconds s2(5); - constexpr std::chrono::microseconds r = s1 + s2; - static_assert(r.count() == 3000005, ""); - } - { - constexpr std::chrono::duration<int, std::ratio<2, 3> > s1(3); - constexpr std::chrono::duration<int, std::ratio<3, 5> > s2(5); - constexpr std::chrono::duration<int, std::ratio<1, 15> > r = s1 + s2; - static_assert(r.count() == 75, ""); - } - { - constexpr std::chrono::duration<int, std::ratio<2, 3> > s1(3); - constexpr std::chrono::duration<double, std::ratio<3, 5> > s2(5); - constexpr std::chrono::duration<double, std::ratio<1, 15> > r = s1 + s2; - static_assert(r.count() == 75, ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_-.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_-.pass.cpp deleted file mode 100644 index fac58b9716d..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_-.pass.cpp +++ /dev/null @@ -1,74 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep1, class Period1, class Rep2, class Period2> -// constexpr -// typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2>>::type -// operator-(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); - -#include <chrono> -#include <cassert> - -int main() -{ - { - std::chrono::seconds s1(3); - std::chrono::seconds s2(5); - std::chrono::seconds r = s1 - s2; - assert(r.count() == -2); - } - { - std::chrono::seconds s1(3); - std::chrono::microseconds s2(5); - std::chrono::microseconds r = s1 - s2; - assert(r.count() == 2999995); - } - { - std::chrono::duration<int, std::ratio<2, 3> > s1(3); - std::chrono::duration<int, std::ratio<3, 5> > s2(5); - std::chrono::duration<int, std::ratio<1, 15> > r = s1 - s2; - assert(r.count() == -15); - } - { - std::chrono::duration<int, std::ratio<2, 3> > s1(3); - std::chrono::duration<double, std::ratio<3, 5> > s2(5); - std::chrono::duration<double, std::ratio<1, 15> > r = s1 - s2; - assert(r.count() == -15); - } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - { - constexpr std::chrono::seconds s1(3); - constexpr std::chrono::seconds s2(5); - constexpr std::chrono::seconds r = s1 - s2; - static_assert(r.count() == -2, ""); - } - { - constexpr std::chrono::seconds s1(3); - constexpr std::chrono::microseconds s2(5); - constexpr std::chrono::microseconds r = s1 - s2; - static_assert(r.count() == 2999995, ""); - } - { - constexpr std::chrono::duration<int, std::ratio<2, 3> > s1(3); - constexpr std::chrono::duration<int, std::ratio<3, 5> > s2(5); - constexpr std::chrono::duration<int, std::ratio<1, 15> > r = s1 - s2; - static_assert(r.count() == -15, ""); - } - { - constexpr std::chrono::duration<int, std::ratio<2, 3> > s1(3); - constexpr std::chrono::duration<double, std::ratio<3, 5> > s2(5); - constexpr std::chrono::duration<double, std::ratio<1, 15> > r = s1 - s2; - static_assert(r.count() == -15, ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_duration.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_duration.pass.cpp deleted file mode 100644 index 6b24676f100..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_duration.pass.cpp +++ /dev/null @@ -1,66 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep1, class Period1, class Rep2, class Period2> -// constexpr -// typename common_type<Rep1, Rep2>::type -// operator/(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); - -#include <chrono> -#include <cassert> - -int main() -{ - { - std::chrono::nanoseconds ns1(15); - std::chrono::nanoseconds ns2(5); - assert(ns1 / ns2 == 3); - } - { - std::chrono::microseconds us1(15); - std::chrono::nanoseconds ns2(5); - assert(us1 / ns2 == 3000); - } - { - std::chrono::duration<int, std::ratio<2, 3> > s1(30); - std::chrono::duration<int, std::ratio<3, 5> > s2(5); - assert(s1 / s2 == 6); - } - { - std::chrono::duration<int, std::ratio<2, 3> > s1(30); - std::chrono::duration<double, std::ratio<3, 5> > s2(5); - assert(s1 / s2 == 20./3); - } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - { - constexpr std::chrono::nanoseconds ns1(15); - constexpr std::chrono::nanoseconds ns2(5); - static_assert(ns1 / ns2 == 3, ""); - } - { - constexpr std::chrono::microseconds us1(15); - constexpr std::chrono::nanoseconds ns2(5); - static_assert(us1 / ns2 == 3000, ""); - } - { - constexpr std::chrono::duration<int, std::ratio<2, 3> > s1(30); - constexpr std::chrono::duration<int, std::ratio<3, 5> > s2(5); - static_assert(s1 / s2 == 6, ""); - } - { - constexpr std::chrono::duration<int, std::ratio<2, 3> > s1(30); - constexpr std::chrono::duration<double, std::ratio<3, 5> > s2(5); - static_assert(s1 / s2 == 20./3, ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.fail.cpp deleted file mode 100644 index db725773fd4..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.fail.cpp +++ /dev/null @@ -1,26 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep1, class Period, class Rep2> -// duration<typename common_type<Rep1, Rep2>::type, Period> -// operator/(const duration<Rep1, Period>& d, const Rep2& s); - -#include <chrono> - -#include "../../rep.h" - -int main() -{ - std::chrono::duration<Rep> d(Rep(15)); - d = d / 5; -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.pass.cpp deleted file mode 100644 index 3036cde5bf6..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.pass.cpp +++ /dev/null @@ -1,36 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep1, class Period, class Rep2> -// constexpr -// duration<typename common_type<Rep1, Rep2>::type, Period> -// operator/(const duration<Rep1, Period>& d, const Rep2& s); - -#include <chrono> -#include <cassert> - -int main() -{ - { - std::chrono::nanoseconds ns(15); - ns = ns / 5; - assert(ns.count() == 3); - } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - { - constexpr std::chrono::nanoseconds ns(15); - constexpr std::chrono::nanoseconds ns2 = ns / 5; - static_assert(ns2.count() == 3, ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_duration.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_duration.pass.cpp deleted file mode 100644 index e69f3205d14..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_duration.pass.cpp +++ /dev/null @@ -1,62 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep1, class Period1, class Rep2, class Period2> -// constexpr -// typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2>>::type -// operator%(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); - -#include <chrono> -#include <cassert> - -int main() -{ - { - std::chrono::nanoseconds ns1(15); - std::chrono::nanoseconds ns2(6); - std::chrono::nanoseconds r = ns1 % ns2; - assert(r.count() == 3); - } - { - std::chrono::microseconds us1(15); - std::chrono::nanoseconds ns2(28); - std::chrono::nanoseconds r = us1 % ns2; - assert(r.count() == 20); - } - { - std::chrono::duration<int, std::ratio<3, 5> > s1(6); - std::chrono::duration<int, std::ratio<2, 3> > s2(3); - std::chrono::duration<int, std::ratio<1, 15> > r = s1 % s2; - assert(r.count() == 24); - } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - { - constexpr std::chrono::nanoseconds ns1(15); - constexpr std::chrono::nanoseconds ns2(6); - constexpr std::chrono::nanoseconds r = ns1 % ns2; - static_assert(r.count() == 3, ""); - } - { - constexpr std::chrono::microseconds us1(15); - constexpr std::chrono::nanoseconds ns2(28); - constexpr std::chrono::nanoseconds r = us1 % ns2; - static_assert(r.count() == 20, ""); - } - { - constexpr std::chrono::duration<int, std::ratio<3, 5> > s1(6); - constexpr std::chrono::duration<int, std::ratio<2, 3> > s2(3); - constexpr std::chrono::duration<int, std::ratio<1, 15> > r = s1 % s2; - static_assert(r.count() == 24, ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.fail.cpp deleted file mode 100644 index 16e511d44f6..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.fail.cpp +++ /dev/null @@ -1,26 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep1, class Period, class Rep2> -// duration<typename common_type<Rep1, Rep2>::type, Period> -// operator%(const duration<Rep1, Period>& d, const Rep2& s) - -#include <chrono> - -#include "../../rep.h" - -int main() -{ - std::chrono::duration<Rep> d(Rep(15)); - d = d % 5; -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.pass.cpp deleted file mode 100644 index 1acbe34ea5e..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.pass.cpp +++ /dev/null @@ -1,36 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep1, class Period, class Rep2> -// constexpr -// duration<typename common_type<Rep1, Rep2>::type, Period> -// operator%(const duration<Rep1, Period>& d, const Rep2& s) - -#include <chrono> -#include <cassert> - -int main() -{ - { - std::chrono::nanoseconds ns(15); - ns = ns % 6; - assert(ns.count() == 3); - } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - { - constexpr std::chrono::nanoseconds ns(15); - constexpr std::chrono::nanoseconds ns2 = ns % 6; - static_assert(ns2.count() == 3, ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep.pass.cpp deleted file mode 100644 index 190e74b1dc3..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep.pass.cpp +++ /dev/null @@ -1,45 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep1, class Period, class Rep2> -// constexpr -// duration<typename common_type<Rep1, Rep2>::type, Period> -// operator*(const duration<Rep1, Period>& d, const Rep2& s); - -// template <class Rep1, class Period, class Rep2> -// constexpr -// duration<typename common_type<Rep1, Rep2>::type, Period> -// operator*(const Rep1& s, const duration<Rep2, Period>& d); - -#include <chrono> -#include <cassert> - -int main() -{ - { - std::chrono::nanoseconds ns(3); - ns = ns * 5; - assert(ns.count() == 15); - ns = 6 * ns; - assert(ns.count() == 90); - } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - { - constexpr std::chrono::nanoseconds ns(3); - constexpr std::chrono::nanoseconds ns2 = ns * 5; - static_assert(ns2.count() == 15, ""); - constexpr std::chrono::nanoseconds ns3 = 6 * ns; - static_assert(ns3.count() == 18, ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep1.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep1.fail.cpp deleted file mode 100644 index d8160500f91..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep1.fail.cpp +++ /dev/null @@ -1,30 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep1, class Period, class Rep2> -// duration<typename common_type<Rep1, Rep2>::type, Period> -// operator*(const duration<Rep1, Period>& d, const Rep2& s); - -// template <class Rep1, class Period, class Rep2> -// duration<typename common_type<Rep1, Rep2>::type, Period> -// operator*(const Rep1& s, const duration<Rep2, Period>& d); - -#include <chrono> - -#include "../../rep.h" - -int main() -{ - std::chrono::duration<Rep> d; - d = d * 5; -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep2.fail.cpp b/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep2.fail.cpp deleted file mode 100644 index e224ba94210..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.nonmember/op_times_rep2.fail.cpp +++ /dev/null @@ -1,30 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// template <class Rep1, class Period, class Rep2> -// duration<typename common_type<Rep1, Rep2>::type, Period> -// operator*(const duration<Rep1, Period>& d, const Rep2& s); - -// template <class Rep1, class Period, class Rep2> -// duration<typename common_type<Rep1, Rep2>::type, Period> -// operator*(const Rep1& s, const duration<Rep2, Period>& d); - -#include <chrono> - -#include "../../rep.h" - -int main() -{ - std::chrono::duration<Rep> d; - d = 5 * d; -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.observer/tested_elsewhere.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.observer/tested_elsewhere.pass.cpp deleted file mode 100644 index b58f5c55b64..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.observer/tested_elsewhere.pass.cpp +++ /dev/null @@ -1,12 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -int main() -{ -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.special/max.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.special/max.pass.cpp deleted file mode 100644 index 405461e88ae..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.special/max.pass.cpp +++ /dev/null @@ -1,43 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// static constexpr duration max(); - -#include <chrono> -#include <limits> -#include <cassert> - -#include "../../rep.h" - -template <class D> -void test() -{ - { - typedef typename D::rep Rep; - Rep max_rep = std::chrono::duration_values<Rep>::max(); - assert(D::max().count() == max_rep); - } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - { - typedef typename D::rep Rep; - constexpr Rep max_rep = std::chrono::duration_values<Rep>::max(); - static_assert(D::max().count() == max_rep, ""); - } -#endif -} - -int main() -{ - test<std::chrono::duration<int> >(); - test<std::chrono::duration<Rep> >(); -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.special/min.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.special/min.pass.cpp deleted file mode 100644 index 44cd64eff3d..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.special/min.pass.cpp +++ /dev/null @@ -1,43 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// static constexpr duration min(); - -#include <chrono> -#include <limits> -#include <cassert> - -#include "../../rep.h" - -template <class D> -void test() -{ - { - typedef typename D::rep Rep; - Rep min_rep = std::chrono::duration_values<Rep>::min(); - assert(D::min().count() == min_rep); - } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - { - typedef typename D::rep Rep; - constexpr Rep min_rep = std::chrono::duration_values<Rep>::min(); - static_assert(D::min().count() == min_rep, ""); - } -#endif -} - -int main() -{ - test<std::chrono::duration<int> >(); - test<std::chrono::duration<Rep> >(); -} diff --git a/libcxx/test/utilities/time/time.duration/time.duration.special/zero.pass.cpp b/libcxx/test/utilities/time/time.duration/time.duration.special/zero.pass.cpp deleted file mode 100644 index 18350fe2ff4..00000000000 --- a/libcxx/test/utilities/time/time.duration/time.duration.special/zero.pass.cpp +++ /dev/null @@ -1,42 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// static constexpr duration zero(); - -#include <chrono> -#include <cassert> - -#include "../../rep.h" - -template <class D> -void test() -{ - { - typedef typename D::rep Rep; - Rep zero_rep = std::chrono::duration_values<Rep>::zero(); - assert(D::zero().count() == zero_rep); - } -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - { - typedef typename D::rep Rep; - constexpr Rep zero_rep = std::chrono::duration_values<Rep>::zero(); - static_assert(D::zero().count() == zero_rep, ""); - } -#endif -} - -int main() -{ - test<std::chrono::duration<int> >(); - test<std::chrono::duration<Rep> >(); -} diff --git a/libcxx/test/utilities/time/time.duration/types.pass.cpp b/libcxx/test/utilities/time/time.duration/types.pass.cpp deleted file mode 100644 index 8eaffe77651..00000000000 --- a/libcxx/test/utilities/time/time.duration/types.pass.cpp +++ /dev/null @@ -1,27 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration - -// Test nested types - -// typedef Rep rep; -// typedef Period period; - -#include <chrono> -#include <type_traits> - -int main() -{ - typedef std::chrono::duration<long, std::ratio<3, 2> > D; - static_assert((std::is_same<D::rep, long>::value), ""); - static_assert((std::is_same<D::period, std::ratio<3, 2> >::value), ""); -} diff --git a/libcxx/test/utilities/time/time.point/default_duration.pass.cpp b/libcxx/test/utilities/time/time.point/default_duration.pass.cpp deleted file mode 100644 index dfdf225ed47..00000000000 --- a/libcxx/test/utilities/time/time.point/default_duration.pass.cpp +++ /dev/null @@ -1,26 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// time_point - -// Test default template arg: - -// template <class Clock, class Duration = typename Clock::duration> -// class time_point; - -#include <chrono> -#include <type_traits> - -int main() -{ - static_assert((std::is_same<std::chrono::system_clock::duration, - std::chrono::time_point<std::chrono::system_clock>::duration>::value), ""); -} diff --git a/libcxx/test/utilities/time/time.point/duration.fail.cpp b/libcxx/test/utilities/time/time.point/duration.fail.cpp deleted file mode 100644 index ee48bcb392e..00000000000 --- a/libcxx/test/utilities/time/time.point/duration.fail.cpp +++ /dev/null @@ -1,22 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// time_point - -// Duration shall be an instance of duration. - -#include <chrono> - -int main() -{ - typedef std::chrono::time_point<std::chrono::system_clock, int> T; - T t; -} diff --git a/libcxx/test/utilities/time/time.point/time.point.arithmetic/op_+=.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.arithmetic/op_+=.pass.cpp deleted file mode 100644 index ffe855ce903..00000000000 --- a/libcxx/test/utilities/time/time.point/time.point.arithmetic/op_+=.pass.cpp +++ /dev/null @@ -1,26 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// time_point - -// time_point& operator+=(const duration& d); - -#include <chrono> -#include <cassert> - -int main() -{ - typedef std::chrono::system_clock Clock; - typedef std::chrono::milliseconds Duration; - std::chrono::time_point<Clock, Duration> t(Duration(3)); - t += Duration(2); - assert(t.time_since_epoch() == Duration(5)); -} diff --git a/libcxx/test/utilities/time/time.point/time.point.arithmetic/op_-=.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.arithmetic/op_-=.pass.cpp deleted file mode 100644 index acad1cfecb4..00000000000 --- a/libcxx/test/utilities/time/time.point/time.point.arithmetic/op_-=.pass.cpp +++ /dev/null @@ -1,26 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// time_point - -// time_point& operator-=(const duration& d); - -#include <chrono> -#include <cassert> - -int main() -{ - typedef std::chrono::system_clock Clock; - typedef std::chrono::milliseconds Duration; - std::chrono::time_point<Clock, Duration> t(Duration(3)); - t -= Duration(2); - assert(t.time_since_epoch() == Duration(1)); -} diff --git a/libcxx/test/utilities/time/time.point/time.point.cast/time_point_cast.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.cast/time_point_cast.pass.cpp deleted file mode 100644 index 7d7e82ac5e2..00000000000 --- a/libcxx/test/utilities/time/time.point/time.point.cast/time_point_cast.pass.cpp +++ /dev/null @@ -1,80 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// time_point - -// template <class ToDuration, class Clock, class Duration> -// time_point<Clock, ToDuration> -// time_point_cast(const time_point<Clock, Duration>& t); - -#include <chrono> -#include <type_traits> -#include <cassert> - -template <class FromDuration, class ToDuration> -void -test(const FromDuration& df, const ToDuration& d) -{ - typedef std::chrono::system_clock Clock; - typedef std::chrono::time_point<Clock, FromDuration> FromTimePoint; - typedef std::chrono::time_point<Clock, ToDuration> ToTimePoint; - { - FromTimePoint f(df); - ToTimePoint t(d); - typedef decltype(std::chrono::time_point_cast<ToDuration>(f)) R; - static_assert((std::is_same<R, ToTimePoint>::value), ""); - assert(std::chrono::time_point_cast<ToDuration>(f) == t); - } -} - -#if _LIBCPP_STD_VER > 11 - -template<class FromDuration, long long From, class ToDuration, long long To> -void test_constexpr () -{ - typedef std::chrono::system_clock Clock; - typedef std::chrono::time_point<Clock, FromDuration> FromTimePoint; - typedef std::chrono::time_point<Clock, ToDuration> ToTimePoint; - { - constexpr FromTimePoint f{FromDuration{From}}; - constexpr ToTimePoint t{ToDuration{To}}; - static_assert(std::chrono::time_point_cast<ToDuration>(f) == t, ""); - } - -} - -#endif - -int main() -{ - test(std::chrono::milliseconds(7265000), std::chrono::hours(2)); - test(std::chrono::milliseconds(7265000), std::chrono::minutes(121)); - test(std::chrono::milliseconds(7265000), std::chrono::seconds(7265)); - test(std::chrono::milliseconds(7265000), std::chrono::milliseconds(7265000)); - test(std::chrono::milliseconds(7265000), std::chrono::microseconds(7265000000LL)); - test(std::chrono::milliseconds(7265000), std::chrono::nanoseconds(7265000000000LL)); - test(std::chrono::milliseconds(7265000), - std::chrono::duration<double, std::ratio<3600> >(7265./3600)); - test(std::chrono::duration<int, std::ratio<2, 3> >(9), - std::chrono::duration<int, std::ratio<3, 5> >(10)); -#if _LIBCPP_STD_VER > 11 - { - test_constexpr<std::chrono::milliseconds, 7265000, std::chrono::hours, 2> (); - test_constexpr<std::chrono::milliseconds, 7265000, std::chrono::minutes,121> (); - test_constexpr<std::chrono::milliseconds, 7265000, std::chrono::seconds,7265> (); - test_constexpr<std::chrono::milliseconds, 7265000, std::chrono::milliseconds,7265000> (); - test_constexpr<std::chrono::milliseconds, 7265000, std::chrono::microseconds,7265000000LL> (); - test_constexpr<std::chrono::milliseconds, 7265000, std::chrono::nanoseconds,7265000000000LL> (); - typedef std::chrono::duration<int, std::ratio<3, 5>> T1; - test_constexpr<std::chrono::duration<int, std::ratio<2, 3>>, 9, T1, 10> (); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.point/time.point.cast/toduration.fail.cpp b/libcxx/test/utilities/time/time.point/time.point.cast/toduration.fail.cpp deleted file mode 100644 index de1e5bb3e27..00000000000 --- a/libcxx/test/utilities/time/time.point/time.point.cast/toduration.fail.cpp +++ /dev/null @@ -1,28 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// time_point - -// template <class ToDuration, class Clock, class Duration> -// time_point<Clock, ToDuration> -// time_point_cast(const time_point<Clock, Duration>& t); - -// ToDuration shall be an instantiation of duration. - -#include <chrono> - -int main() -{ - typedef std::chrono::system_clock Clock; - typedef std::chrono::time_point<Clock, std::chrono::milliseconds> FromTimePoint; - typedef std::chrono::time_point<Clock, std::chrono::minutes> ToTimePoint; - std::chrono::time_point_cast<ToTimePoint>(FromTimePoint(std::chrono::milliseconds(3))); -} diff --git a/libcxx/test/utilities/time/time.point/time.point.comparisons/op_equal.fail.cpp b/libcxx/test/utilities/time/time.point/time.point.comparisons/op_equal.fail.cpp deleted file mode 100644 index f5ff11958ba..00000000000 --- a/libcxx/test/utilities/time/time.point/time.point.comparisons/op_equal.fail.cpp +++ /dev/null @@ -1,40 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// time_point - -// template <class Clock, class Duration1, class Duration2> -// bool -// operator==(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); - -// template <class Clock, class Duration1, class Duration2> -// bool -// operator!=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); - -// time_points with different clocks should not compare - -#include <chrono> - -#include "../../clock.h" - -int main() -{ - typedef std::chrono::system_clock Clock1; - typedef Clock Clock2; - typedef std::chrono::milliseconds Duration1; - typedef std::chrono::microseconds Duration2; - typedef std::chrono::time_point<Clock1, Duration1> T1; - typedef std::chrono::time_point<Clock2, Duration2> T2; - - T1 t1(Duration1(3)); - T2 t2(Duration2(3000)); - t1 == t2; -} diff --git a/libcxx/test/utilities/time/time.point/time.point.comparisons/op_equal.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.comparisons/op_equal.pass.cpp deleted file mode 100644 index fbd3a1386d3..00000000000 --- a/libcxx/test/utilities/time/time.point/time.point.comparisons/op_equal.pass.cpp +++ /dev/null @@ -1,84 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// time_point - -// template <class Clock, class Duration1, class Duration2> -// bool -// operator==(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); - -// template <class Clock, class Duration1, class Duration2> -// bool -// operator!=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); - -#include <chrono> -#include <cassert> - -int main() -{ - typedef std::chrono::system_clock Clock; - typedef std::chrono::milliseconds Duration1; - typedef std::chrono::microseconds Duration2; - typedef std::chrono::time_point<Clock, Duration1> T1; - typedef std::chrono::time_point<Clock, Duration2> T2; - - { - T1 t1(Duration1(3)); - T1 t2(Duration1(3)); - assert( (t1 == t2)); - assert(!(t1 != t2)); - } - { - T1 t1(Duration1(3)); - T1 t2(Duration1(4)); - assert(!(t1 == t2)); - assert( (t1 != t2)); - } - { - T1 t1(Duration1(3)); - T2 t2(Duration2(3000)); - assert( (t1 == t2)); - assert(!(t1 != t2)); - } - { - T1 t1(Duration1(3)); - T2 t2(Duration2(3001)); - assert(!(t1 == t2)); - assert( (t1 != t2)); - } - -#if _LIBCPP_STD_VER > 11 - { - constexpr T1 t1(Duration1(3)); - constexpr T1 t2(Duration1(3)); - static_assert( (t1 == t2), ""); - static_assert(!(t1 != t2), ""); - } - { - constexpr T1 t1(Duration1(3)); - constexpr T1 t2(Duration1(4)); - static_assert(!(t1 == t2), ""); - static_assert( (t1 != t2), ""); - } - { - constexpr T1 t1(Duration1(3)); - constexpr T2 t2(Duration2(3000)); - static_assert( (t1 == t2), ""); - static_assert(!(t1 != t2), ""); - } - { - constexpr T1 t1(Duration1(3)); - constexpr T2 t2(Duration2(3001)); - static_assert(!(t1 == t2), ""); - static_assert( (t1 != t2), ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.point/time.point.comparisons/op_less.fail.cpp b/libcxx/test/utilities/time/time.point/time.point.comparisons/op_less.fail.cpp deleted file mode 100644 index f9745cbf9de..00000000000 --- a/libcxx/test/utilities/time/time.point/time.point.comparisons/op_less.fail.cpp +++ /dev/null @@ -1,48 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// time_point - -// template <class Clock, class Duration1, class Duration2> -// bool -// operator< (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); - -// template <class Clock, class Duration1, class Duration2> -// bool -// operator> (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); - -// template <class Clock, class Duration1, class Duration2> -// bool -// operator<=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); - -// template <class Clock, class Duration1, class Duration2> -// bool -// operator>=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); - -// time_points with different clocks should not compare - -#include <chrono> - -#include "../../clock.h" - -int main() -{ - typedef std::chrono::system_clock Clock1; - typedef Clock Clock2; - typedef std::chrono::milliseconds Duration1; - typedef std::chrono::microseconds Duration2; - typedef std::chrono::time_point<Clock1, Duration1> T1; - typedef std::chrono::time_point<Clock2, Duration2> T2; - - T1 t1(Duration1(3)); - T2 t2(Duration2(3000)); - t1 < t2; -} diff --git a/libcxx/test/utilities/time/time.point/time.point.comparisons/op_less.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.comparisons/op_less.pass.cpp deleted file mode 100644 index 9d94400ed3d..00000000000 --- a/libcxx/test/utilities/time/time.point/time.point.comparisons/op_less.pass.cpp +++ /dev/null @@ -1,108 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// time_point - -// template <class Clock, class Duration1, class Duration2> -// bool -// operator< (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); - -// template <class Clock, class Duration1, class Duration2> -// bool -// operator> (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); - -// template <class Clock, class Duration1, class Duration2> -// bool -// operator<=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); - -// template <class Clock, class Duration1, class Duration2> -// bool -// operator>=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); - -#include <chrono> -#include <cassert> - -int main() -{ - typedef std::chrono::system_clock Clock; - typedef std::chrono::milliseconds Duration1; - typedef std::chrono::microseconds Duration2; - typedef std::chrono::time_point<Clock, Duration1> T1; - typedef std::chrono::time_point<Clock, Duration2> T2; - - { - T1 t1(Duration1(3)); - T1 t2(Duration1(3)); - assert(!(t1 < t2)); - assert(!(t1 > t2)); - assert( (t1 <= t2)); - assert( (t1 >= t2)); - } - { - T1 t1(Duration1(3)); - T1 t2(Duration1(4)); - assert( (t1 < t2)); - assert(!(t1 > t2)); - assert( (t1 <= t2)); - assert(!(t1 >= t2)); - } - { - T1 t1(Duration1(3)); - T2 t2(Duration2(3000)); - assert(!(t1 < t2)); - assert(!(t1 > t2)); - assert( (t1 <= t2)); - assert( (t1 >= t2)); - } - { - T1 t1(Duration1(3)); - T2 t2(Duration2(3001)); - assert( (t1 < t2)); - assert(!(t1 > t2)); - assert( (t1 <= t2)); - assert(!(t1 >= t2)); - } - -#if _LIBCPP_STD_VER > 11 - { - constexpr T1 t1(Duration1(3)); - constexpr T1 t2(Duration1(3)); - static_assert(!(t1 < t2), ""); - static_assert(!(t1 > t2), ""); - static_assert( (t1 <= t2), ""); - static_assert( (t1 >= t2), ""); - } - { - constexpr T1 t1(Duration1(3)); - constexpr T1 t2(Duration1(4)); - static_assert( (t1 < t2), ""); - static_assert(!(t1 > t2), ""); - static_assert( (t1 <= t2), ""); - static_assert(!(t1 >= t2), ""); - } - { - constexpr T1 t1(Duration1(3)); - constexpr T2 t2(Duration2(3000)); - static_assert(!(t1 < t2), ""); - static_assert(!(t1 > t2), ""); - static_assert( (t1 <= t2), ""); - static_assert( (t1 >= t2), ""); - } - { - constexpr T1 t1(Duration1(3)); - constexpr T2 t2(Duration2(3001)); - static_assert( (t1 < t2), ""); - static_assert(!(t1 > t2), ""); - static_assert( (t1 <= t2), ""); - static_assert(!(t1 >= t2), ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.point/time.point.cons/convert.fail.cpp b/libcxx/test/utilities/time/time.point/time.point.cons/convert.fail.cpp deleted file mode 100644 index 565aa6c4f52..00000000000 --- a/libcxx/test/utilities/time/time.point/time.point.cons/convert.fail.cpp +++ /dev/null @@ -1,30 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// time_point - -// template <class Duration2> -// time_point(const time_point<clock, Duration2>& t); - -// Duration2 shall be implicitly convertible to duration. - -#include <chrono> - -int main() -{ - typedef std::chrono::system_clock Clock; - typedef std::chrono::milliseconds Duration1; - typedef std::chrono::microseconds Duration2; - { - std::chrono::time_point<Clock, Duration2> t2(Duration2(3)); - std::chrono::time_point<Clock, Duration1> t1 = t2; - } -} diff --git a/libcxx/test/utilities/time/time.point/time.point.cons/convert.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.cons/convert.pass.cpp deleted file mode 100644 index 6cd7dcb7d2f..00000000000 --- a/libcxx/test/utilities/time/time.point/time.point.cons/convert.pass.cpp +++ /dev/null @@ -1,37 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// time_point - -// template <class Duration2> -// time_point(const time_point<clock, Duration2>& t); - -#include <chrono> -#include <cassert> - -int main() -{ - typedef std::chrono::system_clock Clock; - typedef std::chrono::microseconds Duration1; - typedef std::chrono::milliseconds Duration2; - { - std::chrono::time_point<Clock, Duration2> t2(Duration2(3)); - std::chrono::time_point<Clock, Duration1> t1 = t2; - assert(t1.time_since_epoch() == Duration1(3000)); - } -#if _LIBCPP_STD_VER > 11 - { - constexpr std::chrono::time_point<Clock, Duration2> t2(Duration2(3)); - constexpr std::chrono::time_point<Clock, Duration1> t1 = t2; - static_assert(t1.time_since_epoch() == Duration1(3000), ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.point/time.point.cons/default.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.cons/default.pass.cpp deleted file mode 100644 index 01f0bc16993..00000000000 --- a/libcxx/test/utilities/time/time.point/time.point.cons/default.pass.cpp +++ /dev/null @@ -1,35 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// time_point - -// time_point(); - -#include <chrono> -#include <cassert> - -#include "../../rep.h" - -int main() -{ - typedef std::chrono::system_clock Clock; - typedef std::chrono::duration<Rep, std::milli> Duration; - { - std::chrono::time_point<Clock, Duration> t; - assert(t.time_since_epoch() == Duration::zero()); - } -#if _LIBCPP_STD_VER > 11 - { - constexpr std::chrono::time_point<Clock, Duration> t; - static_assert(t.time_since_epoch() == Duration::zero(), ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.point/time.point.cons/duration.fail.cpp b/libcxx/test/utilities/time/time.point/time.point.cons/duration.fail.cpp deleted file mode 100644 index 810007ed942..00000000000 --- a/libcxx/test/utilities/time/time.point/time.point.cons/duration.fail.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// time_point - -// explicit time_point(const duration& d); - -// test for explicit - -#include <chrono> - -int main() -{ - typedef std::chrono::system_clock Clock; - typedef std::chrono::milliseconds Duration; - std::chrono::time_point<Clock, Duration> t = Duration(3); -} diff --git a/libcxx/test/utilities/time/time.point/time.point.cons/duration.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.cons/duration.pass.cpp deleted file mode 100644 index 9d53d86dea3..00000000000 --- a/libcxx/test/utilities/time/time.point/time.point.cons/duration.pass.cpp +++ /dev/null @@ -1,41 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// time_point - -// explicit time_point(const duration& d); - -#include <chrono> -#include <cassert> - -int main() -{ - typedef std::chrono::system_clock Clock; - typedef std::chrono::milliseconds Duration; - { - std::chrono::time_point<Clock, Duration> t(Duration(3)); - assert(t.time_since_epoch() == Duration(3)); - } - { - std::chrono::time_point<Clock, Duration> t(std::chrono::seconds(3)); - assert(t.time_since_epoch() == Duration(3000)); - } -#if _LIBCPP_STD_VER > 11 - { - constexpr std::chrono::time_point<Clock, Duration> t(Duration(3)); - static_assert(t.time_since_epoch() == Duration(3), ""); - } - { - constexpr std::chrono::time_point<Clock, Duration> t(std::chrono::seconds(3)); - static_assert(t.time_since_epoch() == Duration(3000), ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.point/time.point.nonmember/op_+.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.nonmember/op_+.pass.cpp deleted file mode 100644 index 7a8fa6dcf14..00000000000 --- a/libcxx/test/utilities/time/time.point/time.point.nonmember/op_+.pass.cpp +++ /dev/null @@ -1,46 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// time_point - -// template <class Clock, class Duration1, class Rep2, class Period2> -// time_point<Clock, typename common_type<Duration1, duration<Rep2, Period2>>::type> -// operator+(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs); - -// template <class Rep1, class Period1, class Clock, class Duration2> -// time_point<Clock, typename common_type<duration<Rep1, Period1>, Duration2>::type> -// operator+(const duration<Rep1, Period1>& lhs, const time_point<Clock, Duration2>& rhs); - -#include <chrono> -#include <cassert> - -int main() -{ - typedef std::chrono::system_clock Clock; - typedef std::chrono::milliseconds Duration1; - typedef std::chrono::microseconds Duration2; - { - std::chrono::time_point<Clock, Duration1> t1(Duration1(3)); - std::chrono::time_point<Clock, Duration2> t2 = t1 + Duration2(5); - assert(t2.time_since_epoch() == Duration2(3005)); - t2 = Duration2(6) + t1; - assert(t2.time_since_epoch() == Duration2(3006)); - } -#if _LIBCPP_STD_VER > 11 - { - constexpr std::chrono::time_point<Clock, Duration1> t1(Duration1(3)); - constexpr std::chrono::time_point<Clock, Duration2> t2 = t1 + Duration2(5); - static_assert(t2.time_since_epoch() == Duration2(3005), ""); - constexpr std::chrono::time_point<Clock, Duration2> t3 = Duration2(6) + t1; - static_assert(t3.time_since_epoch() == Duration2(3006), ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.point/time.point.nonmember/op_-duration.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.nonmember/op_-duration.pass.cpp deleted file mode 100644 index 342d27b5aeb..00000000000 --- a/libcxx/test/utilities/time/time.point/time.point.nonmember/op_-duration.pass.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// time_point - -// template <class Clock, class Duration1, class Rep2, class Period2> -// time_point<Clock, typename common_type<Duration1, duration<Rep2, Period2>>::type> -// operator-(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs); - -#include <chrono> -#include <cassert> - -int main() -{ - typedef std::chrono::system_clock Clock; - typedef std::chrono::milliseconds Duration1; - typedef std::chrono::microseconds Duration2; - { - std::chrono::time_point<Clock, Duration1> t1(Duration1(3)); - std::chrono::time_point<Clock, Duration2> t2 = t1 - Duration2(5); - assert(t2.time_since_epoch() == Duration2(2995)); - } -#if _LIBCPP_STD_VER > 11 - { - constexpr std::chrono::time_point<Clock, Duration1> t1(Duration1(3)); - constexpr std::chrono::time_point<Clock, Duration2> t2 = t1 - Duration2(5); - static_assert(t2.time_since_epoch() == Duration2(2995), ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.point/time.point.nonmember/op_-time_point.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.nonmember/op_-time_point.pass.cpp deleted file mode 100644 index 5267f07e1b8..00000000000 --- a/libcxx/test/utilities/time/time.point/time.point.nonmember/op_-time_point.pass.cpp +++ /dev/null @@ -1,38 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// time_point - -// template <class Clock, class Duration1, class Duration2> -// typename common_type<Duration1, Duration2>::type -// operator-(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); - -#include <chrono> -#include <cassert> - -int main() -{ - typedef std::chrono::system_clock Clock; - typedef std::chrono::milliseconds Duration1; - typedef std::chrono::microseconds Duration2; - { - std::chrono::time_point<Clock, Duration1> t1(Duration1(3)); - std::chrono::time_point<Clock, Duration2> t2(Duration2(5)); - assert((t1 - t2) == Duration2(2995)); - } -#if _LIBCPP_STD_VER > 11 - { - constexpr std::chrono::time_point<Clock, Duration1> t1(Duration1(3)); - constexpr std::chrono::time_point<Clock, Duration2> t2(Duration2(5)); - static_assert((t1 - t2) == Duration2(2995), ""); - } -#endif -} diff --git a/libcxx/test/utilities/time/time.point/time.point.observer/tested_elsewhere.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.observer/tested_elsewhere.pass.cpp deleted file mode 100644 index b58f5c55b64..00000000000 --- a/libcxx/test/utilities/time/time.point/time.point.observer/tested_elsewhere.pass.cpp +++ /dev/null @@ -1,12 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -int main() -{ -} diff --git a/libcxx/test/utilities/time/time.point/time.point.special/max.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.special/max.pass.cpp deleted file mode 100644 index 6bba6fc8278..00000000000 --- a/libcxx/test/utilities/time/time.point/time.point.special/max.pass.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// time_point - -// static constexpr time_point max(); - -#include <chrono> -#include <cassert> - -int main() -{ - typedef std::chrono::system_clock Clock; - typedef std::chrono::milliseconds Duration; - typedef std::chrono::time_point<Clock, Duration> TP; - assert(TP::max() == TP(Duration::max())); -} diff --git a/libcxx/test/utilities/time/time.point/time.point.special/min.pass.cpp b/libcxx/test/utilities/time/time.point/time.point.special/min.pass.cpp deleted file mode 100644 index b1d955c252a..00000000000 --- a/libcxx/test/utilities/time/time.point/time.point.special/min.pass.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// time_point - -// static constexpr time_point min(); - -#include <chrono> -#include <cassert> - -int main() -{ - typedef std::chrono::system_clock Clock; - typedef std::chrono::milliseconds Duration; - typedef std::chrono::time_point<Clock, Duration> TP; - assert(TP::min() == TP(Duration::min())); -} diff --git a/libcxx/test/utilities/time/time.traits/nothing_to_do.pass.cpp b/libcxx/test/utilities/time/time.traits/nothing_to_do.pass.cpp deleted file mode 100644 index b58f5c55b64..00000000000 --- a/libcxx/test/utilities/time/time.traits/nothing_to_do.pass.cpp +++ /dev/null @@ -1,12 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -int main() -{ -} diff --git a/libcxx/test/utilities/time/time.traits/time.traits.duration_values/max.pass.cpp b/libcxx/test/utilities/time/time.traits/time.traits.duration_values/max.pass.cpp deleted file mode 100644 index 89dc1dcc1a5..00000000000 --- a/libcxx/test/utilities/time/time.traits/time.traits.duration_values/max.pass.cpp +++ /dev/null @@ -1,36 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration_values::max - -#include <chrono> -#include <limits> -#include <cassert> - -#include "../../rep.h" - -int main() -{ - assert(std::chrono::duration_values<int>::max() == - std::numeric_limits<int>::max()); - assert(std::chrono::duration_values<double>::max() == - std::numeric_limits<double>::max()); - assert(std::chrono::duration_values<Rep>::max() == - std::numeric_limits<Rep>::max()); -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - static_assert(std::chrono::duration_values<int>::max() == - std::numeric_limits<int>::max(), ""); - static_assert(std::chrono::duration_values<double>::max() == - std::numeric_limits<double>::max(), ""); - static_assert(std::chrono::duration_values<Rep>::max() == - std::numeric_limits<Rep>::max(), ""); -#endif -} diff --git a/libcxx/test/utilities/time/time.traits/time.traits.duration_values/min.pass.cpp b/libcxx/test/utilities/time/time.traits/time.traits.duration_values/min.pass.cpp deleted file mode 100644 index 69812bba006..00000000000 --- a/libcxx/test/utilities/time/time.traits/time.traits.duration_values/min.pass.cpp +++ /dev/null @@ -1,36 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration_values::min - -#include <chrono> -#include <limits> -#include <cassert> - -#include "../../rep.h" - -int main() -{ - assert(std::chrono::duration_values<int>::min() == - std::numeric_limits<int>::lowest()); - assert(std::chrono::duration_values<double>::min() == - std::numeric_limits<double>::lowest()); - assert(std::chrono::duration_values<Rep>::min() == - std::numeric_limits<Rep>::lowest()); -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - static_assert(std::chrono::duration_values<int>::min() == - std::numeric_limits<int>::lowest(), ""); - static_assert(std::chrono::duration_values<double>::min() == - std::numeric_limits<double>::lowest(), ""); - static_assert(std::chrono::duration_values<Rep>::min() == - std::numeric_limits<Rep>::lowest(), ""); -#endif -} diff --git a/libcxx/test/utilities/time/time.traits/time.traits.duration_values/zero.pass.cpp b/libcxx/test/utilities/time/time.traits/time.traits.duration_values/zero.pass.cpp deleted file mode 100644 index 234b4bc31c9..00000000000 --- a/libcxx/test/utilities/time/time.traits/time.traits.duration_values/zero.pass.cpp +++ /dev/null @@ -1,27 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// duration_values::zero - -#include <chrono> -#include <cassert> - -#include "../../rep.h" - -int main() -{ - assert(std::chrono::duration_values<int>::zero() == 0); - assert(std::chrono::duration_values<Rep>::zero() == 0); -#ifndef _LIBCPP_HAS_NO_CONSTEXPR - static_assert(std::chrono::duration_values<int>::zero() == 0, ""); - static_assert(std::chrono::duration_values<Rep>::zero() == 0, ""); -#endif -} diff --git a/libcxx/test/utilities/time/time.traits/time.traits.is_fp/treat_as_floating_point.pass.cpp b/libcxx/test/utilities/time/time.traits/time.traits.is_fp/treat_as_floating_point.pass.cpp deleted file mode 100644 index c32350faa83..00000000000 --- a/libcxx/test/utilities/time/time.traits/time.traits.is_fp/treat_as_floating_point.pass.cpp +++ /dev/null @@ -1,37 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// treat_as_floating_point - -#include <chrono> -#include <type_traits> - -template <class T> -void -test() -{ - static_assert((std::is_base_of<std::is_floating_point<T>, - std::chrono::treat_as_floating_point<T> >::value), ""); -} - -struct A {}; - -int main() -{ - test<int>(); - test<unsigned>(); - test<char>(); - test<bool>(); - test<float>(); - test<double>(); - test<long double>(); - test<A>(); -} diff --git a/libcxx/test/utilities/time/time.traits/time.traits.specializations/duration.pass.cpp b/libcxx/test/utilities/time/time.traits/time.traits.specializations/duration.pass.cpp deleted file mode 100644 index f942844b60a..00000000000 --- a/libcxx/test/utilities/time/time.traits/time.traits.specializations/duration.pass.cpp +++ /dev/null @@ -1,42 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// template <class Rep1, class Period1, class Rep2, class Period2> -// struct common_type<chrono::duration<Rep1, Period1>, chrono::duration<Rep2, Period2>> -// { -// typedef chrono::duration<typename common_type<Rep1, Rep2>::type, see below }> type; -// }; - -#include <chrono> - -template <class D1, class D2, class De> -void -test() -{ - typedef typename std::common_type<D1, D2>::type Dc; - static_assert((std::is_same<Dc, De>::value), ""); -} - -int main() -{ - test<std::chrono::duration<int, std::ratio<1, 100> >, - std::chrono::duration<long, std::ratio<1, 1000> >, - std::chrono::duration<long, std::ratio<1, 1000> > >(); - test<std::chrono::duration<long, std::ratio<1, 100> >, - std::chrono::duration<int, std::ratio<1, 1000> >, - std::chrono::duration<long, std::ratio<1, 1000> > >(); - test<std::chrono::duration<char, std::ratio<1, 30> >, - std::chrono::duration<short, std::ratio<1, 1000> >, - std::chrono::duration<int, std::ratio<1, 3000> > >(); - test<std::chrono::duration<double, std::ratio<21, 1> >, - std::chrono::duration<short, std::ratio<15, 1> >, - std::chrono::duration<double, std::ratio<3, 1> > >(); -} diff --git a/libcxx/test/utilities/time/time.traits/time.traits.specializations/time_point.pass.cpp b/libcxx/test/utilities/time/time.traits/time.traits.specializations/time_point.pass.cpp deleted file mode 100644 index a0786b49924..00000000000 --- a/libcxx/test/utilities/time/time.traits/time.traits.specializations/time_point.pass.cpp +++ /dev/null @@ -1,46 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -// template <class Clock, class Duration1, class Duration2> -// struct common_type<chrono::time_point<Clock, Duration1>, chrono::time_point<Clock, Duration2>> -// { -// typedef chrono::time_point<Clock, typename common_type<Duration1, Duration2>::type> type; -// }; - -#include <chrono> - -template <class D1, class D2, class De> -void -test() -{ - typedef std::chrono::system_clock C; - typedef std::chrono::time_point<C, D1> T1; - typedef std::chrono::time_point<C, D2> T2; - typedef std::chrono::time_point<C, De> Te; - typedef typename std::common_type<T1, T2>::type Tc; - static_assert((std::is_same<Tc, Te>::value), ""); -} - -int main() -{ - test<std::chrono::duration<int, std::ratio<1, 100> >, - std::chrono::duration<long, std::ratio<1, 1000> >, - std::chrono::duration<long, std::ratio<1, 1000> > >(); - test<std::chrono::duration<long, std::ratio<1, 100> >, - std::chrono::duration<int, std::ratio<1, 1000> >, - std::chrono::duration<long, std::ratio<1, 1000> > >(); - test<std::chrono::duration<char, std::ratio<1, 30> >, - std::chrono::duration<short, std::ratio<1, 1000> >, - std::chrono::duration<int, std::ratio<1, 3000> > >(); - test<std::chrono::duration<double, std::ratio<21, 1> >, - std::chrono::duration<short, std::ratio<15, 1> >, - std::chrono::duration<double, std::ratio<3, 1> > >(); -} diff --git a/libcxx/test/utilities/time/version.pass.cpp b/libcxx/test/utilities/time/version.pass.cpp deleted file mode 100644 index bfa3f6d6797..00000000000 --- a/libcxx/test/utilities/time/version.pass.cpp +++ /dev/null @@ -1,20 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -// <chrono> - -#include <chrono> - -#ifndef _LIBCPP_VERSION -#error _LIBCPP_VERSION not defined -#endif - -int main() -{ -} |

