1 //===----------------------------------------------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // <random>
11
12 // template <class UIntType, UIntType a, UIntType c, UIntType m>
13 // class linear_congruential_engine;
14
15 // void seed(result_type s = default_seed);
16
17 #include <random>
18 #include <cassert>
19
20 template <class T>
21 void
test1()22 test1()
23 {
24 for (int s = 0; s < 20; ++s)
25 {
26 typedef std::linear_congruential_engine<T, 2, 3, 7> E;
27 E e1(s);
28 E e2;
29 e2.seed(s);
30 assert(e1 == e2);
31 }
32 }
33
main()34 int main()
35 {
36 test1<unsigned short>();
37 test1<unsigned int>();
38 test1<unsigned long>();
39 test1<unsigned long long>();
40 }
41