Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / input.output / iostream.format / std.manip / setfill.pass.cpp
blob3413743eaf66a8e44eaacd73db6fcf971ea8790e
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 // <iomanip>
11 // template<charT> T4 setfill(charT c);
13 #include <iomanip>
14 #include <ostream>
15 #include <cassert>
17 #include "test_macros.h"
19 template <class CharT>
20 struct testbuf
21 : public std::basic_streambuf<CharT>
23 testbuf() {}
26 int main(int, char**)
29 testbuf<char> sb;
30 std::ostream os(&sb);
31 os << std::setfill('*');
32 assert(os.fill() == '*');
34 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
36 testbuf<wchar_t> sb;
37 std::wostream os(&sb);
38 os << std::setfill(L'*');
39 assert(os.fill() == L'*');
41 #endif
43 return 0;