[PATCH] Add experimental::sample and experimental::shuffle from N4531

Jonathan Wakely jwakely@redhat.com
Fri Jun 29 07:21:00 GMT 2018


On 29/06/18 08:55 +0200, Christophe Lyon wrote:
>On Mon, 25 Jun 2018 at 18:23, Jonathan Wakely <jwakely@redhat.com> wrote:
>>
>> The additions to <experimental/random> were added in 2015 but the new
>> algorithms in <experimental/algorithm> were not. This adds them.
>>
>>         * include/experimental/algorithm (sample, shuffle): Add new overloads
>>         using per-thread random number engine.
>>         * testsuite/experimental/algorithm/sample.cc: Simpify and reduce
>>         dependencies by using __gnu_test::test_container.
>>         * testsuite/experimental/algorithm/sample-2.cc: New.
>>         * testsuite/experimental/algorithm/shuffle.cc: New.
>>
>> Tested x86_64-linux, committed to trunk.
>>
>> This would be safe to backport, but nobody has noticed the algos are
>> missing or complained, so it doesn't seem very important to backport.
>>
>>
>
>Hi,
>
>On bare-metal targets (aarch64 and arm + newlib), I've noticed that
>the two new tests fail:
>PASS: experimental/algorithm/shuffle.cc (test for excess errors)
>spawn /aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/utils/bin/qemu-wrapper.sh
>./shuffle.exe
>terminate called after throwing an instance of 'std::runtime_error'
>  what():  random_device::random_device(const std::string&)
>
>*** EXIT code 4242
>FAIL: experimental/algorithm/shuffle.cc execution test
>
>PASS: experimental/algorithm/sample-2.cc (test for excess errors)
>spawn /aci-gcc-fsf/builds/gcc-fsf-gccsrc/obj-arm-none-eabi/gcc3/utils/bin/qemu-wrapper.sh
>./sample-2.exe
>terminate called after throwing an instance of 'std::runtime_error'
>  what():  random_device::random_device(const std::string&)
>
>*** EXIT code 4242
>FAIL: experimental/algorithm/sample-2.cc execution test
>
>Does this ring a bell?

Does the existing testsuite/experimental/random/randint.cc file fail
in the same way?




More information about the Libstdc++ mailing list