This is an archive of the discontinued LLVM Phabricator instance.

[NFC][sanitizer] Add basic hash test
ClosedPublic

Authored by vitalybuka on Oct 5 2021, 12:11 PM.

Diff Detail

Event Timeline

vitalybuka created this revision.Oct 5 2021, 12:11 PM
vitalybuka requested review of this revision.Oct 5 2021, 12:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 5 2021, 12:11 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript

I'm not sure what does this test test.
Do we depend anywhere on the hash function producing these exact values, or is it part of an abi contract?

I'm not sure what does this test test.
Do we depend anywhere on the hash function producing these exact values, or is it part of an abi contract?

It tests MurMur2HashBuilder implementation, it should return precise values.

I'm not sure what does this test test.
Do we depend anywhere on the hash function producing these exact values, or is it part of an abi contract?

Almost all out unittest are not about contract or ABI, for that we usually use lit tests.
This is regression tests, if it fail, we have a problem.

vitalybuka updated this revision to Diff 377336.Oct 5 2021, 1:16 PM

repaced constants tested on reference implementation

morehouse added inline comments.Oct 5 2021, 2:22 PM
compiler-rt/lib/sanitizer_common/tests/sanitizer_hash_test.cpp
10

Maybe explain here that these are regression tests to ensure consistent hash results and that we don't unintentionally change the hash algorithm.

eugenis accepted this revision.Oct 5 2021, 2:24 PM

LGTM

This revision is now accepted and ready to land.Oct 5 2021, 2:24 PM
vitalybuka marked an inline comment as done.Oct 5 2021, 9:29 PM
This revision was automatically updated to reflect the committed changes.