//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // template // class linear_congruential_engine; // void discard(unsigned long long z); #include #include #include "test_macros.h" template void rand0() { typedef std::linear_congruential_engine E; E e; e.discard(9999); assert(e() == 1043618065); } template void rand() { typedef std::linear_congruential_engine E; E e; e.discard(9999); assert(e() == 399268537); } template void other() { typedef std::linear_congruential_engine E; E e1; E e2; assert(e1 == e2); e1.discard(1); assert(e1 != e2); (void)e2(); assert(e1 == e2); e1.discard(3); assert(e1 != e2); (void)e2(); (void)e2(); (void)e2(); assert(e1 == e2); } int main(int, char**) { rand0(); rand0(); rand0(); rand(); rand(); rand(); other(); other(); other(); return 0; }