This is an archive of the discontinued LLVM Phabricator instance.

[libc] Small adjustments to fenv tests
ClosedPublic

Authored by michaelrj on Jan 28 2021, 4:40 PM.

Details

Summary

Some libcs define non-standard FE_* macros and include them in
FE_ALL_EXCEPT. This change adjusts the fenv tests so that the
non-standard FE_* macros do not interfere when compiled with
fenv.h from another libc.

Diff Detail

Event Timeline

michaelrj created this revision.Jan 28 2021, 4:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 28 2021, 4:40 PM
michaelrj requested review of this revision.Jan 28 2021, 4:40 PM
sivachandra added inline comments.Jan 28 2021, 5:16 PM
libc/test/src/fenv/enabled_exceptions_test.cpp
30

Add a comment here, something like:

We '|' the individual exception flags instead of using FE_ALL_EXCEPT
as it can include non-standard extensions. Note that we should be able
to compile this file with headers from other libcs as well.
libc/test/src/fenv/exception_status_test.cpp
114

You should be able to use allExcepts below instead of FE_ALL_EXCEPT?

sivachandra retitled this revision from [libc] small fixes to FEnv tests to [libc] Small adjustments to fenv tests.Jan 28 2021, 5:20 PM
sivachandra edited the summary of this revision. (Show Details)
sivachandra accepted this revision.Jan 28 2021, 5:23 PM

Accepting now but please land after fixing comments.

This revision is now accepted and ready to land.Jan 28 2021, 5:23 PM
michaelrj marked 2 inline comments as done.

fix the comments and change the final test in RaiseAndTest

This revision was automatically updated to reflect the committed changes.