1 //===----------------------------------------------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // <strstream>
11
12 // class strstreambuf
13
14 // int overflow(int c);
15
16 // There was an overflow in the dylib on older macOS versions
17 // UNSUPPORTED: with_system_cxx_lib=macosx10.8
18 // UNSUPPORTED: with_system_cxx_lib=macosx10.7
19
20 #include <iostream>
21 #include <string>
22 #include <strstream>
23
main()24 int main() {
25 std::ostrstream oss;
26 std::string s;
27
28 for (int i = 0; i < 4096; ++i)
29 s.push_back((i % 16) + 'a');
30
31 oss << s << std::ends;
32 std::cout << oss.str();
33 oss.freeze(false);
34
35 return 0;
36 }
37