Fix bug in random.
Test: ./run_test.py --bitness 32 Test: ./run_test.py --bitness 64 Test: ./run_test.py --bitness 64 --host Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=994957 Bug: http://b/139690488 Change-Id: I71708114d7fc8ed90c30b4d32b01d3f3aef7600b (cherry picked from commit a1d1caa3d831030ce802ed335a9743180911d553)
This commit is contained in:
@@ -29,6 +29,20 @@ sqr(T x)
|
||||
return x * x;
|
||||
}
|
||||
|
||||
struct Eng : std::mt19937 {
|
||||
using Base = std::mt19937;
|
||||
using Base::Base;
|
||||
};
|
||||
|
||||
void test_small_inputs() {
|
||||
Eng engine;
|
||||
std::geometric_distribution<std::int16_t> distribution(5.45361e-311);
|
||||
for (auto i=0; i < 1000; ++i) {
|
||||
volatile auto res = distribution(engine);
|
||||
((void)res);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
test1()
|
||||
{
|
||||
@@ -295,4 +309,5 @@ int main()
|
||||
test4();
|
||||
test5();
|
||||
test6();
|
||||
test_small_inputs();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user