This is an archive of the discontinued LLVM Phabricator instance.

[support] Revise ScopedPrinter formatting tests for floats
ClosedPublic

Authored by paulkirth on Mar 24 2023, 3:56 PM.

Details

Summary

Previously there were several attempts to make the format checks for NaN
and Inf work across platforms, like AIX and Solaris, that print these
values slightly differently. This resulted in a number of forward fixes,
until we finally disabled the tests for NaN and Inf. This change should
make the test robust across different platforms, and reduce the overall
amount of code by delegating to helper functions that use the same
format strings as the implementations used by PrintNumber().

This additionally reverts commit 5a9bad171be5dfdf9430a0f6cbff14d29ca54181
and fa56e362af475e0758cfb41c42f78db50da7235c.

Diff Detail

Event Timeline

paulkirth created this revision.Mar 24 2023, 3:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2023, 3:56 PM
paulkirth requested review of this revision.Mar 24 2023, 3:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2023, 3:56 PM

@abhina.sreeskantharajan would you be able to test this out on AIX?

jhenderson accepted this revision.Mar 27 2023, 12:53 AM

LGTM, but should get the AIX/Solaris people have verified the fix.

llvm/unittests/Support/ScopedPrinterTest.cpp
513

Nit

524
This revision is now accepted and ready to land.Mar 27 2023, 12:53 AM
ro added a comment.Mar 27 2023, 5:35 AM

LGTM, but should get the AIX/Solaris people have verified the fix.

I've tested the fix on Solaris/amd64: the test still PASSes. Thanks.

I've added reviewers that are more familiar with AIX

In D146851#4223843, @ro wrote:

LGTM, but should get the AIX/Solaris people have verified the fix.

I've tested the fix on Solaris/amd64: the test still PASSes. Thanks.

Thanks for taking the time to do that. Sorry it took a while to get this right.

I've added reviewers that are more familiar with AIX

Thank you!

paulkirth updated this revision to Diff 508698.Mar 27 2023, 9:30 AM

Add missing . to comments

paulkirth marked 2 inline comments as done.Mar 27 2023, 9:30 AM