//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // class linear_congruential_engine; // void discard(unsigned long long z); #include #include 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); e2(); assert(e1 == e2); e1.discard(3); assert(e1 != e2); e2(); e2(); e2(); assert(e1 == e2); } int main() { rand0(); rand0(); rand0(); rand(); rand(); rand(); other(); other(); other(); }