This is an archive of the discontinued LLVM Phabricator instance.

[libc++][print] Adds stdout functions.
ClosedPublic

Authored by Mordante on Jul 13 2023, 10:51 PM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Commits
rGe2953303f4d3: [libc++][print] Adds stdout functions.
Summary

Implements parts of

  • P2093R14 Formatted output
  • P2539R4 Should the output of std::print to a terminal be synchronized with the underlying stream?

Depends on D150044

Diff Detail

Event Timeline

Mordante created this revision.Jul 13 2023, 10:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2023, 10:51 PM
Mordante updated this revision to Diff 540658.Jul 15 2023, 2:42 AM

CI fixes.

Mordante updated this revision to Diff 540670.Jul 15 2023, 3:28 AM

CI fixes.

Mordante updated this revision to Diff 540686.Jul 15 2023, 7:42 AM

Disable failing println test on Windows.

Mordante updated this revision to Diff 540696.Jul 15 2023, 9:30 AM

Disables the right test.

Mordante published this revision for review.Jul 17 2023, 8:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 17 2023, 8:33 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne added inline comments.
libcxx/test/std/input.output/iostream.format/print.fun/check-stdout.sh
5–6 ↗(On Diff #540696)
9–14 ↗(On Diff #540696)
libcxx/test/std/input.output/iostream.format/print.fun/print.sh.cpp
27
28
33–34

I think this would work, and it would be a bit simpler cause it would only use the Lit internal shell. We could also remove the dependency on executor-has-no-bash and the FILE_DEPENDENCIES.

39
libcxx/test/std/input.output/iostream.format/print.fun/println.sh.cpp
37

Or the other way around, but IDK why the test passes even with that.

Mordante marked 7 inline comments as done.Jul 20 2023, 8:20 AM
Mordante added inline comments.
libcxx/test/std/input.output/iostream.format/print.fun/check-stdout.sh
5–6 ↗(On Diff #540696)

This file has been removed.

libcxx/test/std/input.output/iostream.format/print.fun/print.sh.cpp
33–34

I tried the suggested approach, but that didn't entirely work, so did it slightly different.

Mordante updated this revision to Diff 542543.Jul 20 2023, 8:21 AM
Mordante marked 2 inline comments as done.

Rebased and addresses review comments.

ldionne accepted this revision.Jul 20 2023, 10:19 AM

This is nice! I like the testing a lot more than what we do for std::cout.

This revision is now accepted and ready to land.Jul 20 2023, 10:19 AM
This revision was automatically updated to reflect the committed changes.