Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/include/llvm/Support/raw_ostream.h
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ class LLVM_ABI raw_null_ostream : public raw_pwrite_stream {
uint64_t current_pos() const override;

public:
explicit raw_null_ostream() = default;
explicit raw_null_ostream() : raw_pwrite_stream(/*Unbuffered=*/true) {}
~raw_null_ostream() override;
};

Expand Down
5 changes: 5 additions & 0 deletions llvm/unittests/Support/raw_ostream_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,11 @@ TEST(raw_ostreamTest, writeToDevNull) {
EXPECT_TRUE(DevNullIsUsed);
}

TEST(raw_ostreamTest, nullStreamZeroBufferSize) {
raw_ostream &NullStream = nulls();
EXPECT_EQ(NullStream.GetBufferSize(), 0u);
}

TEST(raw_ostreamTest, writeToStdOut) {
outs().flush();
testing::internal::CaptureStdout();
Expand Down