This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Regarding chi2_quality.cc test in libstdc++-v3 testsuite for gcc


Hi all,

@austern, sorry to brother you, I forgot to bring the discussion to the mailing list.

Has anyone noticed that, this test fails for 32bit architecture linking with glibc? The VERIFY statement ( VERIFY( chi2 < k*1.1 );) in test_uniform_random() and test_bit_flip_set() fail.

I have tested it on x86_32 and arm-none-linux-eabi, they both fail with the same result. However it passes for x86_64 and aarch64-none-linux-gnu.

Basically the random number generated using rand() are the same, it's the std::hash<> makes the difference.

If the target linked with newlib, this test case for 32-bit arm target passes. However, it's because the implementation of rand() function is different from glibc. If I feed the same set "random" data to the test case(instead of calling rand() function), the results are identical, which means the compiler behaves correctly.

Do you know how to address this? Is the condition for the assertion too strict?

Any information is appreciated!

Kind regards,
Renlin Li


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]