[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / depr / depr.str.strstreams / depr.strstreambuf / depr.strstreambuf.cons / cscp_size.pass.cpp
blob001151c367d785bb44f5ebf507cef9e692ea6322
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 // <strstream>
11 // class strstreambuf
13 // strstreambuf(const signed char* gnext_arg, streamsize n);
15 #include <strstream>
16 #include <cassert>
18 #include "test_macros.h"
20 int main(int, char**)
23 const signed char buf[] = "abcd";
24 std::strstreambuf sb(buf, sizeof(buf));
25 assert(sb.sgetc() == 'a');
26 assert(sb.snextc() == 'b');
27 assert(sb.snextc() == 'c');
28 assert(sb.snextc() == 'd');
29 assert(sb.snextc() == 0);
30 assert(sb.snextc() == EOF);
33 const signed char buf[] = "abcd";
34 std::strstreambuf sb(buf, 0);
35 assert(sb.sgetc() == 'a');
36 assert(sb.snextc() == 'b');
37 assert(sb.snextc() == 'c');
38 assert(sb.snextc() == 'd');
39 assert(sb.snextc() == EOF);
42 return 0;