This is an archive of the discontinued LLVM Phabricator instance.

[libc] Enable the 'stdlib' unit tests to be hermetic
ClosedPublic

Authored by jhuber6 on May 2 2023, 4:37 PM.

Details

Summary

This changes the stdlib tests to the new add_libc_test framework.
This applies to all but the exit tests.

Depends on D149691

Diff Detail

Event Timeline

jhuber6 created this revision.May 2 2023, 4:37 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 2 2023, 4:37 PM
jhuber6 requested review of this revision.May 2 2023, 4:37 PM
michaelrj added inline comments.May 2 2023, 4:41 PM
libc/test/src/stdlib/CMakeLists.txt
111–112

why is this added?

jhuber6 added inline comments.May 2 2023, 4:42 PM
libc/test/src/stdlib/CMakeLists.txt
111–112

Discussed with Siva in the discord, but otherwise it will emit a call to a compiler-rt function for __floatuntixf.

This revision is now accepted and ready to land.May 2 2023, 4:44 PM

Can you hold off on landing this. I do want to understand why we are still getting link errors even with https://reviews.llvm.org/D149683.

sivachandra added inline comments.May 3 2023, 12:52 AM
libc/test/UnitTest/RoundingModeUtils.cpp
40

This will be break when LLVM's libc is being used in the overlay mode and fenv comes from the system libc. I don't have a better suggestion though.

libc/test/src/CMakeLists.txt
37

Instead of creating another fp testing function, WDYT of https://reviews.llvm.org/D149728

libc/test/src/stdlib/CMakeLists.txt
111–112

ISTM that you did not apply https://reviews.llvm.org/D149683 when you were testing? I have landed it now, can you try again? I am not able to repro this problem after I have landed https://reviews.llvm.org/D149683.

264

Nit: Move this right under the name so that it catches the reader's eye.

jhuber6 updated this revision to Diff 519045.May 3 2023, 5:54 AM

Making suggested changes.

sivachandra accepted this revision.May 3 2023, 9:07 AM
sivachandra added inline comments.
libc/test/src/CMakeLists.txt
22

FATAL_ERROR

37

Do we still need this?

jhuber6 added inline comments.May 3 2023, 9:09 AM
libc/test/src/CMakeLists.txt
37

Nope.

jhuber6 updated this revision to Diff 519107.May 3 2023, 9:15 AM

Remove unused.

This revision was automatically updated to reflect the committed changes.