summaryrefslogtreecommitdiffstats
path: root/libcxx/test/numerics/complex.number/complex.ops/complex_not_equals_complex.pass.cpp
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2013-07-31 21:02:34 +0000
committerMarshall Clow <mclow.lists@gmail.com>2013-07-31 21:02:34 +0000
commita1cd191624ac80604078b901d90c07d0122d6798 (patch)
treed65caf9ff576d0feed67c64eb60288c8cd2705a6 /libcxx/test/numerics/complex.number/complex.ops/complex_not_equals_complex.pass.cpp
parenta09e44c75d13edfbdc0a70bf517e625886e092db (diff)
downloadbcm5719-llvm-a1cd191624ac80604078b901d90c07d0122d6798.tar.gz
bcm5719-llvm-a1cd191624ac80604078b901d90c07d0122d6798.zip
Implement constexpr (n3302) and fix operator *= and /=
llvm-svn: 187529
Diffstat (limited to 'libcxx/test/numerics/complex.number/complex.ops/complex_not_equals_complex.pass.cpp')
-rw-r--r--libcxx/test/numerics/complex.number/complex.ops/complex_not_equals_complex.pass.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/libcxx/test/numerics/complex.number/complex.ops/complex_not_equals_complex.pass.cpp b/libcxx/test/numerics/complex.number/complex.ops/complex_not_equals_complex.pass.cpp
index 9f40a188c01..f5ff3fd1dac 100644
--- a/libcxx/test/numerics/complex.number/complex.ops/complex_not_equals_complex.pass.cpp
+++ b/libcxx/test/numerics/complex.number/complex.ops/complex_not_equals_complex.pass.cpp
@@ -18,11 +18,23 @@
template <class T>
void
-test(const std::complex<T>& lhs, const std::complex<T>& rhs, bool x)
+test_constexpr()
{
- assert((lhs != rhs) == x);
+#if _LIBCPP_STD_VER > 11
+ {
+ constexpr std::complex<T> lhs(1.5, 2.5);
+ constexpr std::complex<T> rhs(1.5, -2.5);
+ static_assert(lhs != rhs, "");
+ }
+ {
+ constexpr std::complex<T> lhs(1.5, 2.5);
+ constexpr std::complex<T> rhs(1.5, 2.5);
+ static_assert(!(lhs != rhs), "" );
+ }
+#endif
}
+
template <class T>
void
test()
@@ -30,18 +42,21 @@ test()
{
std::complex<T> lhs(1.5, 2.5);
std::complex<T> rhs(1.5, -2.5);
- test(lhs, rhs, true);
+ assert(lhs != rhs);
}
{
std::complex<T> lhs(1.5, 2.5);
std::complex<T> rhs(1.5, 2.5);
- test(lhs, rhs, false);
+ assert(!(lhs != rhs));
}
-}
+
+ test_constexpr<T> ();
+ }
int main()
{
test<float>();
test<double>();
test<long double>();
+// test_constexpr<int> ();
}
OpenPOWER on IntegriCloud