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, size_t w, size_t n, size_t m, size_t r,
13 //           UIntType a, size_t u, UIntType d, size_t s,
14 //           UIntType b, size_t t, UIntType c, size_t l, UIntType f>
15 // class mersenne_twister_engine;
16 
17 // mersenne_twister_engine(const mersenne_twister_engine&);
18 
19 #include <random>
20 #include <cassert>
21 
22 void
test1()23 test1()
24 {
25     typedef std::mt19937 E;
26     E e1;
27     e1();
28     E e2 = e1;
29     assert(e1 == e2);
30     assert(e1() == e2());
31     E::result_type k = e1();
32     assert(e1 != e2);
33     assert(e2() == k);
34     assert(e1 == e2);
35 }
36 
37 void
test2()38 test2()
39 {
40     typedef std::mt19937_64 E;
41     E e1;
42     e1();
43     E e2(e1);
44     assert(e1 == e2);
45     assert(e1() == e2());
46     E::result_type k = e1();
47     assert(e1 != e2);
48     assert(e2() == k);
49     assert(e1 == e2);
50 }
51 
main()52 int main()
53 {
54     test1();
55     test2();
56 }
57