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 // explicit mersenne_twister_engine();
18 
19 #include <random>
20 #include <sstream>
21 #include <cassert>
22 
23 void
test1()24 test1()
25 {
26     std::mt19937 e1;
27     std::mt19937 e2(std::mt19937::default_seed);
28     assert(e1 == e2);
29     assert(e1() == 3499211612u);
30 }
31 
32 void
test2()33 test2()
34 {
35     std::mt19937_64 e1;
36     std::mt19937_64 e2(std::mt19937_64::default_seed);
37     assert(e1 == e2);
38     assert(e1() == 14514284786278117030ull);
39 }
40 
main()41 int main()
42 {
43     test1();
44     test2();
45 }
46