Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / depr / depr.str.strstreams / depr.ostrstream / depr.ostrstream.cons / default.pass.cpp
blobabbf6af7e11eb9a8a6285901dd5f81515c9f0db9
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 ostrstream
15 // ostrstream();
17 #include <strstream>
18 #include <cassert>
19 #include <string>
21 #include "test_macros.h"
23 int main(int, char**)
25 std::ostrstream out;
26 int i = 123;
27 double d = 4.5;
28 std::string s("dog");
29 out << i << ' ' << d << ' ' << s << std::ends;
30 assert(out.str() == std::string("123 4.5 dog"));
31 out.freeze(false);
33 return 0;