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
9// <random>
10
11// template<class UIntType, size_t w, size_t s, size_t r>
12// class subtract_with_carry_engine;
13
14// explicit subtract_with_carry_engine();
15
16#include <random>
17#include <cassert>
18
19#include "test_macros.h"
20
21void
22test1()
23{
24 std::ranlux24_base e1;
25 std::ranlux24_base e2(std::ranlux24_base::default_seed);
26 assert(e1 == e2);
27 assert(e1() == 15039276);
28}
29
30void
31test2()
32{
33 std::ranlux48_base e1;
34 std::ranlux48_base e2(std::ranlux48_base::default_seed);
35 assert(e1 == e2);
36 assert(e1() == 23459059301164ull);
37}
38
39int main(int, char**)
40{
41 test1();
42 test2();
43
44 return 0;
45}
46

source code of libcxx/test/std/numerics/rand/rand.eng/rand.eng.sub/default.pass.cpp