diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2015-11-30 05:04:22 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2015-11-30 05:04:22 +0000 |
commit | 4ddfaea7732ea6bee32c615d9bf1dc27d07b4e7a (patch) | |
tree | 637477c27cbd6b0165e8abf15e9649df13c0f541 /libcxx/test/std/utilities/ratio/ratio.comparison/ratio_not_equal.pass.cpp | |
parent | 803a8bb105421fc81673facf5793314252fc583d (diff) | |
download | bcm5719-llvm-4ddfaea7732ea6bee32c615d9bf1dc27d07b4e7a.tar.gz bcm5719-llvm-4ddfaea7732ea6bee32c615d9bf1dc27d07b4e7a.zip |
Implement more of P0006; Type Traits Variable Templates. <ratio>
llvm-svn: 254285
Diffstat (limited to 'libcxx/test/std/utilities/ratio/ratio.comparison/ratio_not_equal.pass.cpp')
-rw-r--r-- | libcxx/test/std/utilities/ratio/ratio.comparison/ratio_not_equal.pass.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/libcxx/test/std/utilities/ratio/ratio.comparison/ratio_not_equal.pass.cpp b/libcxx/test/std/utilities/ratio/ratio.comparison/ratio_not_equal.pass.cpp index ebf93074658..fcd31207fdb 100644 --- a/libcxx/test/std/utilities/ratio/ratio.comparison/ratio_not_equal.pass.cpp +++ b/libcxx/test/std/utilities/ratio/ratio.comparison/ratio_not_equal.pass.cpp @@ -11,46 +11,57 @@ #include <ratio> +#include "test_macros.h" + +template <class Rat1, class Rat2, bool result> +void test() +{ + static_assert((result == std::ratio_not_equal<Rat1, Rat2>::value), ""); +#if TEST_STD_VER > 14 + static_assert((result == std::ratio_not_equal_v<Rat1, Rat2>), ""); +#endif +} + int main() { { typedef std::ratio<1, 1> R1; typedef std::ratio<1, 1> R2; - static_assert((!std::ratio_not_equal<R1, R2>::value), ""); + test<R1, R2, false>(); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; - static_assert((!std::ratio_not_equal<R1, R2>::value), ""); + test<R1, R2, false>(); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; - static_assert((!std::ratio_not_equal<R1, R2>::value), ""); + test<R1, R2, false>(); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R2; - static_assert((!std::ratio_not_equal<R1, R2>::value), ""); + test<R1, R2, false>(); } { typedef std::ratio<1, 1> R1; typedef std::ratio<1, -1> R2; - static_assert((std::ratio_not_equal<R1, R2>::value), ""); + test<R1, R2, true>(); } { typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R2; - static_assert((std::ratio_not_equal<R1, R2>::value), ""); + test<R1, R2, true>(); } { typedef std::ratio<-0x7FFFFFFFFFFFFFFFLL, 1> R1; typedef std::ratio<0x7FFFFFFFFFFFFFFFLL, 1> R2; - static_assert((std::ratio_not_equal<R1, R2>::value), ""); + test<R1, R2, true>(); } { typedef std::ratio<1, 0x7FFFFFFFFFFFFFFFLL> R1; typedef std::ratio<1, -0x7FFFFFFFFFFFFFFFLL> R2; - static_assert((std::ratio_not_equal<R1, R2>::value), ""); + test<R1, R2, true>(); } } |