Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / input.output / iostream.objects / wide.stream.objects / wcerr-wide-mode.sh.cpp
blobf23fbee92afd8e838db513f07bf8343ce3b2c31e
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 // <iostream>
11 // wostream wcerr;
13 // UNSUPPORTED: no-wide-characters
14 // REQUIRES: target={{.+}}-windows-{{.+}}
16 // FILE_DEPENDENCIES: test.dat
17 // RUN: %{build}
18 // RUN: %{exec} %t.exe 2> %t.actual
19 // RUN: diff test.dat %t.actual
21 // Check that wcerr works, preserving the unicode characters, after switching
22 // stderr to wide mode.
24 #include <iostream>
25 #include <io.h>
26 #include <fcntl.h>
28 int main(int, char**) {
29 _setmode(_fileno(stderr), _O_WTEXT);
30 std::wcerr << L"1234\u20ac\u00e5\u00e4\u00f6";
31 return 0;