This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Enables put_long_double test for glibc.
ClosedPublic

Authored by Mordante on Feb 8 2022, 9:44 AM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Commits
rGece0f70664af: [libc++] Enables put_long_double test for glibc.
Summary

Glibc adds a +-sign for NaN-values when showpos fmtflags are set.

[tab:ios.fmtflags]
showpos generates a + sign in non-negative generated numeric output

Since NaNs aren't negative this behaviour seems correct. Enable the test
for glibc and add ifdefs to make sure the existing tests still pass.

This was noticed while working on D118971.

Diff Detail

Event Timeline

Mordante requested review of this revision.Feb 8 2022, 9:44 AM
Mordante created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2022, 9:44 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne accepted this revision.Feb 8 2022, 2:22 PM
ldionne added a subscriber: ldionne.

These C library-specific tests are a bit annoying, but definitely better than disabling them. Thanks for fixing!

This revision is now accepted and ready to land.Feb 8 2022, 2:22 PM

Agreed. I think the test would be possible to write more compact. However I'm not volunteering.

This revision was automatically updated to reflect the committed changes.

Sigh, I had a different patch for this, lying around waiting for attention and review, in D118238, which IMO solved the issue more elegantly (and MUCH fewer ifdefs to maintain, if another platform, say Windows, also would happen to have the same form for the NAN printouts).

@mstorsjo Sorry I missed that review and I discovered this issue during an unrelated cleanup.