This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by jhuber6 on May 3 2023, 8:02 AM.

Details

Summary

This patch updates the __support unit tests to be built as hermetic
tests. The only tests we needed to disable were because of the use of
realloc which is not implemented correctly as it doesn't copy the
memory.

Depends on D149745

Diff Detail

Event Timeline

jhuber6 created this revision.May 3 2023, 8:02 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 3 2023, 8:02 AM
jhuber6 requested review of this revision.May 3 2023, 8:02 AM
sivachandra added inline comments.May 3 2023, 9:13 AM
jhuber6 added inline comments.May 3 2023, 9:14 AM
libc/test/src/__support/CMakeLists.txt
91

Doesn't realloc need to copy the old memory? This just allocates a new pointer, which is going to be zero thus the tests fail and print an empty string.

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

Ah, yes! Indeed!

This revision is now accepted and ready to land.May 3 2023, 9:17 AM
This revision was landed with ongoing or failed builds.May 3 2023, 9:38 AM
This revision was automatically updated to reflect the committed changes.