Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / localization / locales / locale.convenience / conversions / conversions.buffer / rdbuf.pass.cpp
blobc9c134592bf6b68121de25f2a2d4dc0b0adcec37
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 // <locale>
11 // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
13 // wbuffer_convert<Codecvt, Elem, Tr>
15 // streambuf *rdbuf(streambuf *bytebuf);
17 // XFAIL: no-wide-characters
19 #include <locale>
20 #include <codecvt>
21 #include <sstream>
22 #include <cassert>
24 #include "test_macros.h"
26 int main(int, char**)
28 typedef std::wbuffer_convert<std::codecvt_utf8<wchar_t> > B;
30 std::stringstream s;
31 B b;
32 assert(b.rdbuf() == nullptr);
33 b.rdbuf(s.rdbuf());
34 assert(b.rdbuf() == s.rdbuf());
37 return 0;