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 //===----------------------------------------------------------------------===// 8 9 // <iostream> 10 11 // istream wcerr; 12 13 // RUN: %{build} 14 // RUN: %{exec} %t.exe 2> %t.err 15 // RUN: grep -e 'Hello World!' %t.err 16 17 #include <iostream> 18 #include <cassert> 19 20 #include "test_macros.h" 21 22 int main(int, char**) 23 { 24 std::wcerr << L"Hello World!\n"; 25 26 #ifdef _LIBCPP_HAS_NO_STDOUT 27 assert(std::wcerr.tie() == NULL); 28 #else 29 assert(std::wcerr.tie() == &std::wcout); 30 #endif 31 assert(std::wcerr.flags() & std::ios_base::unitbuf); 32 33 return 0; 34 } 35