[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / libcxx / test / std / numerics / rand / rand.eng / rand.eng.sub / io.pass.cpp
blobd5222842294d1b09d5a3bd9c614a198ee7366daf
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 //===----------------------------------------------------------------------===//
9 // <random>
11 // template<class UIntType, size_t w, size_t s, size_t r>
12 // class subtract_with_carry_engine;
14 // template <class charT, class traits,
15 // class UIntType, size_t w, size_t s, size_t r>
16 // basic_ostream<charT, traits>&
17 // operator<<(basic_ostream<charT, traits>& os,
18 // const subtract_with_carry_engine<UIntType, w, s, r>& x);
20 // template <class charT, class traits,
21 // class UIntType, size_t w, size_t s, size_t r>
22 // basic_istream<charT, traits>&
23 // operator>>(basic_istream<charT, traits>& is,
24 // subtract_with_carry_engine<UIntType, w, s, r>& x);
26 #include <random>
27 #include <sstream>
28 #include <cassert>
30 #include "test_macros.h"
32 void
33 test1()
35 typedef std::ranlux24_base E;
36 E e1;
37 e1.discard(100);
38 std::ostringstream os;
39 os << e1;
40 std::istringstream is(os.str());
41 E e2;
42 is >> e2;
43 assert(e1 == e2);
46 void
47 test2()
49 typedef std::ranlux48_base E;
50 E e1;
51 e1.discard(100);
52 std::ostringstream os;
53 os << e1;
54 std::istringstream is(os.str());
55 E e2;
56 is >> e2;
57 assert(e1 == e2);
60 int main(int, char**)
62 test1();
63 test2();
65 return 0;