Zhang Xiongpang: Add definitions for const data members. Fixes http://llvm.org/bugs/show_bug.cgi?id=14585.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@170026 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -25,6 +25,9 @@
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
template <class _Tp>
|
||||
void where(const _Tp &) {}
|
||||
|
||||
template <class T, T a, T c, T m>
|
||||
void
|
||||
test1()
|
||||
@@ -37,6 +40,10 @@ test1()
|
||||
/*static_*/assert((LCE::min() == (c == 0u ? 1u: 0u))/*, ""*/);
|
||||
/*static_*/assert((LCE::max() == result_type(m - 1u))/*, ""*/);
|
||||
static_assert((LCE::default_seed == 1), "");
|
||||
where(LCE::multiplier);
|
||||
where(LCE::increment);
|
||||
where(LCE::modulus);
|
||||
where(LCE::default_seed);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
|
@@ -40,6 +40,9 @@
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
template <class _Tp>
|
||||
void where(const _Tp &) {}
|
||||
|
||||
void
|
||||
test1()
|
||||
{
|
||||
@@ -60,6 +63,20 @@ test1()
|
||||
/*static_*/assert((E::min() == 0)/*, ""*/);
|
||||
/*static_*/assert((E::max() == 0xFFFFFFFF)/*, ""*/);
|
||||
static_assert((E::default_seed == 5489u), "");
|
||||
where(E::word_size);
|
||||
where(E::state_size);
|
||||
where(E::shift_size);
|
||||
where(E::mask_bits);
|
||||
where(E::xor_mask);
|
||||
where(E::tempering_u);
|
||||
where(E::tempering_d);
|
||||
where(E::tempering_s);
|
||||
where(E::tempering_b);
|
||||
where(E::tempering_t);
|
||||
where(E::tempering_c);
|
||||
where(E::tempering_l);
|
||||
where(E::initialization_multiplier);
|
||||
where(E::default_seed);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -82,6 +99,20 @@ test2()
|
||||
/*static_*/assert((E::min() == 0)/*, ""*/);
|
||||
/*static_*/assert((E::max() == 0xFFFFFFFFFFFFFFFFull)/*, ""*/);
|
||||
static_assert((E::default_seed == 5489u), "");
|
||||
where(E::word_size);
|
||||
where(E::state_size);
|
||||
where(E::shift_size);
|
||||
where(E::mask_bits);
|
||||
where(E::xor_mask);
|
||||
where(E::tempering_u);
|
||||
where(E::tempering_d);
|
||||
where(E::tempering_s);
|
||||
where(E::tempering_b);
|
||||
where(E::tempering_t);
|
||||
where(E::tempering_c);
|
||||
where(E::tempering_l);
|
||||
where(E::initialization_multiplier);
|
||||
where(E::default_seed);
|
||||
}
|
||||
|
||||
int main()
|
||||
|
@@ -28,6 +28,9 @@
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
template <class _Tp>
|
||||
void where(const _Tp &) {}
|
||||
|
||||
void
|
||||
test1()
|
||||
{
|
||||
@@ -38,6 +41,10 @@ test1()
|
||||
/*static_*/assert((E::min() == 0)/*, ""*/);
|
||||
/*static_*/assert((E::max() == 0xFFFFFF)/*, ""*/);
|
||||
static_assert((E::default_seed == 19780503u), "");
|
||||
where(E::word_size);
|
||||
where(E::short_lag);
|
||||
where(E::long_lag);
|
||||
where(E::default_seed);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -50,6 +57,10 @@ test2()
|
||||
/*static_*/assert((E::min() == 0)/*, ""*/);
|
||||
/*static_*/assert((E::max() == 0xFFFFFFFFFFFFull)/*, ""*/);
|
||||
static_assert((E::default_seed == 19780503u), "");
|
||||
where(E::word_size);
|
||||
where(E::short_lag);
|
||||
where(E::long_lag);
|
||||
where(E::default_seed);
|
||||
}
|
||||
|
||||
int main()
|
||||
|
Reference in New Issue
Block a user