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// XFAIL: LIBCXX-PICOLIBC-FIXME
10
11// <iostream>
12
13// ostream cerr;
14
15// RUN: %{build}
16// RUN: %{exec} %t.exe 2> %t.actual
17// RUN: echo -n 1234 > %t.expected
18// RUN: diff %t.expected %t.actual
19
20#include <iostream>
21#include <cassert>
22
23#include "test_macros.h"
24
25int main(int, char**) {
26 std::cerr << "1234";
27 assert(std::cerr.flags() & std::ios_base::unitbuf);
28 assert(std::cerr.tie() == &std::cout);
29 return 0;
30}
31

source code of libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/cerr.sh.cpp