[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / depr / depr.str.strstreams / depr.istrstream / depr.istrstream.cons / ccp.pass.cpp
blobb5ee0bfbecf082399846644a9c2457dd9fbdaf8f
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 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
11 // <strstream>
13 // class istrstream
15 // explicit istrstream(const char* s);
17 #include <strstream>
18 #include <cassert>
19 #include <string>
21 #include "test_macros.h"
23 int main(int, char**)
26 const char buf[] = "123 4.5 dog";
27 std::istrstream in(buf);
28 int i;
29 in >> i;
30 assert(i == 123);
31 double d;
32 in >> d;
33 assert(d == 4.5);
34 std::string s;
35 in >> s;
36 assert(s == "dog");
37 assert(in.eof());
38 assert(!in.fail());
39 in.clear();
40 in.putback('g');
41 assert(!in.fail());
42 in.putback('g');
43 assert(in.fail());
44 assert(buf[9] == 'o');
45 assert(buf[10] == 'g');
48 return 0;