mt19937.pass.cpp 909 B

123456789101112131415161718192021222324252627282930
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. // <random>
  9. // typedef mersenne_twister_engine<uint_fast32_t, 32, 624, 397, 31,
  10. // 0x9908b0df,
  11. // 11, 0xffffffff,
  12. // 7, 0x9d2c5680,
  13. // 15, 0xefc60000,
  14. // 18, 1812433253> mt19937;
  15. #include <random>
  16. #include <cassert>
  17. #include "test_macros.h"
  18. int main(int, char**)
  19. {
  20. std::mt19937 e;
  21. e.discard(9999);
  22. assert(e() == 4123659995u);
  23. return 0;
  24. }