This is an archive of the discontinued LLVM Phabricator instance.

[libc++][AIX] Fix trivial_abi return tests for unique_ptr/weak_ptr
ClosedPublic

Authored by jsji on Feb 16 2022, 8:20 AM.

Details

Summary

The unique_ptr_ret and weak_ptr_ret tests are not expected to pass on
AIX. These tests check that unique_ptr and weak_ptr are returned by
value, but on AIX, all structs are always returned by reference.

3.9.6 Function Return Values
...

Note: Structures of any length and character strings longer than four
bytes are returned in a storage buffer allocated by the caller. The
address of this buffer is passed as a hidden first argument in GPR3,
which causes the first explicit argument word to be passed in GPR4. This
hidden argument is treated as a formal argument and corresponds to the
first word of the argument area.

Diff Detail

Event Timeline

jsji requested review of this revision.Feb 16 2022, 8:20 AM
jsji created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 16 2022, 8:20 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Quuxplusone added a subscriber: Quuxplusone.
Quuxplusone added inline comments.
libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp
54

This PR LGTM, but for what it's worth, I wonder whether defined(__arm__) might also be true on ARM64...

jsji added inline comments.Feb 16 2022, 8:35 AM
libcxx/test/libcxx/memory/trivial_abi/weak_ptr_ret.pass.cpp
54

Thanks. @Quuxplusone.

I am not familiar with arm, it looks like to me that at least clang does not define __arm__ for AArch64, it use __aarch64__ instead.

daltenty accepted this revision.Feb 16 2022, 11:03 AM

LGTM, thanks!

jsji added a comment.EditedFeb 23 2022, 10:00 AM

Ping.. Can someone in libc++ group help to have a quick look? This only affect AIX test. Thank you so much!

philnik accepted this revision.Feb 23 2022, 10:05 AM
This revision is now accepted and ready to land.Feb 23 2022, 10:05 AM
jsji added a comment.Feb 23 2022, 10:41 AM

Thank you so much Nikolas! @philnik