This is an archive of the discontinued LLVM Phabricator instance.

[libcxx][test][NFC] Add tests for hash_function() and key_eq() in unordered containers
ClosedPublic

Authored by ldionne on Feb 14 2022, 2:58 AM.

Details

Summary

Add tests for hasher hash_function() const and key_equal key_eq() const observers in unordered containers

Diff Detail

Event Timeline

kboyarinov requested review of this revision.Feb 14 2022, 2:58 AM
kboyarinov created this revision.

https://reviews.llvm.org/harbormaster/unit/view/2593320/
https://reviews.llvm.org/harbormaster/unit/view/2593321/

/home/libcxx-builder/.buildkite-agent/builds/998e9b442c55-1/llvm-project/libcxx-ci/build/generic-debug-iterators/include/c++/v1/__hash_table:330: _LIBCPP_ASSERT '::std::__libcpp_is_constant_evaluated() || (__get_const_db()->__dereferenceable(this))' failed. Attempted to dereference a non-dereferenceable unordered container iterator

/home/libcxx-builder/.buildkite-agent/builds/998e9b442c55-1/llvm-project/libcxx-ci/build/generic-debug-iterators/include/c++/v1/__hash_table:442: _LIBCPP_ASSERT '::std::__libcpp_is_constant_evaluated() || (__get_const_db()->__dereferenceable(this))' failed. Attempted to dereference a non-dereferenceable unordered container const_iterator

What's the deal with these failures? The test code doesn't jump out at me as wrong, so I wonder if you've uncovered a bug. Thoughts?

Could you rebase onto main and re-upload this? I suspect the failures might go away now that we've changed a few things about the debug mode.

Herald added a project: Restricted Project. · View Herald TranscriptApr 25 2022, 2:38 PM
rarutyun commandeered this revision.May 3 2022, 3:20 PM
rarutyun updated this revision to Diff 426865.
rarutyun edited reviewers, added: kboyarinov; removed: rarutyun.
rarutyun set the repository for this revision to rG LLVM Github Monorepo.
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald TranscriptMay 3 2022, 3:20 PM

Could you rebase onto main and re-upload this? I suspect the failures might go away now that we've changed a few things about the debug mode.

Rebased

I looked into this a bit, and I think we might not be registering debug iterators properly in unordered_set and unordered_map when we insert. I'm not sure why the rest of the test suite would be happy with this, though.

ldionne accepted this revision.Aug 31 2023, 7:58 AM

This LGTM, I think the CI failures should not be relevant anymore since so much has changed about the debug mode.

This revision is now accepted and ready to land.Aug 31 2023, 7:58 AM
ldionne commandeered this revision.Aug 31 2023, 9:08 AM
ldionne edited reviewers, added: rarutyun; removed: ldionne.

Commandeering to rebase.

This revision now requires review to proceed.Aug 31 2023, 9:08 AM
ldionne updated this revision to Diff 555077.Aug 31 2023, 9:09 AM

Rebase (and run clang-format on the tests)

ldionne updated this revision to Diff 555129.Aug 31 2023, 11:57 AM

Rebase to poke CI.

ldionne accepted this revision.Sep 1 2023, 5:50 AM

The CI failures are with TSAN but everything fails with TSAN right now, so this looks good.

This revision is now accepted and ready to land.Sep 1 2023, 5:50 AM
This revision was landed with ongoing or failed builds.Sep 1 2023, 5:51 AM
This revision was automatically updated to reflect the committed changes.