Page MenuHomePhabricator

[libc++] [test] Fix a few tests for 32-bit x86
ClosedPublic

Authored by hvdijk on May 12 2021, 12:50 PM.

Details

Summary
  • libcxx/gdb/gdb_pretty_printer_test.sh.cpp tests that vectors pretty-print correctly, but the exact output depends on the target: vector<bool> stores its bits in an array of __storage_type, which may be 32 bits.
  • The unique_ptr_ret and weak_ptr_ret tests are not expected to pass on x86. These tests check that unique_ptr and weak_ptr are returned by value, but on x86, all structs are always returned by reference.

Fixes bug 48939.

Diff Detail

Event Timeline

hvdijk created this revision.May 12 2021, 12:50 PM
hvdijk requested review of this revision.May 12 2021, 12:50 PM
Herald added a reviewer: Restricted Project. · View Herald TranscriptMay 12 2021, 12:50 PM
curdeius accepted this revision as: curdeius.May 14 2021, 12:12 AM
curdeius added subscribers: ldionne, curdeius.

LGTM. But please rebase to rerun CI (the commit that provoked the failures has been reverted).
It would be cool if @saugustine could have a look at gdb part though. @ldionne, this patch should unblock adding 32-bit buildbots to CI in D92508.

Also, please update https://bugs.llvm.org/show_bug.cgi?id=48939 and add it to the description.

hvdijk updated this revision to Diff 345371.May 14 2021, 1:31 AM
hvdijk edited the summary of this revision. (Show Details)

This diff is identical to the previous diff, but hopefully a reupload will redo the CI.

Should I continue waiting for @saugustine to check the gdb part of this? If it takes too long to get that reviewed it might be better if I split this in two so that I can at least commit the non-gdb parts already.

saugustine accepted this revision.May 27 2021, 2:20 PM
ldionne requested changes to this revision.May 27 2021, 2:29 PM
ldionne added inline comments.
libcxx/test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp
18

Can we instead use // XFAIL: target-x86?

This revision now requires changes to proceed.May 27 2021, 2:29 PM
hvdijk added inline comments.May 27 2021, 2:47 PM
libcxx/test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp
18

Marking this as XFAIL would suggest to me that there is a bug that we're ignoring for now. I don't think there is: _LIBCPP_ABI_ENABLE_UNIQUE_PTR_TRIVIAL_ABI is behaving exactly as intended, unique_ptr is passed exactly as a trivial type.

ldionne accepted this revision.May 31 2021, 9:34 AM
ldionne added inline comments.
libcxx/test/libcxx/memory/trivial_abi/unique_ptr_ret.pass.cpp
18

XFAIL is also used when the test is expected to fail because the tested behavior doesn't apply to the given configuration - or at least we've been using it for that. But I can see your point, and I'm fine with the current approach.

This revision is now accepted and ready to land.May 31 2021, 9:34 AM
This revision was automatically updated to reflect the committed changes.