This is an archive of the discontinued LLVM Phabricator instance.

[sampleprof] Drop test dependency on the string hash func (NFC)
ClosedPublic

Authored by vsk on Apr 25 2017, 5:45 PM.

Details

Summary

The SampleProfWriter emits function information in an order determined
by the string hash function. The situation is a bit brittle, because
changing the hash function can break the tests.

Instead of sorting the function samples to get a relaible ordering (that
might be too expensive), make the tests not depend on a particular
ordering of function samples.

Diff Detail

Event Timeline

vsk created this revision.Apr 25 2017, 5:45 PM
dnovillo accepted this revision.Apr 26 2017, 6:43 AM

LGTM. Thanks.

This revision is now accepted and ready to land.Apr 26 2017, 6:43 AM
vsk added a comment.Apr 26 2017, 8:39 AM

Sorry about this, but some more testing shows that '*-DAG-NEXT' doesn't work the way I expected it to (it's not a supported FileCheck directive). I will have to relax the tests a bit more.

vsk updated this revision to Diff 96753.Apr 26 2017, 8:47 AM

Relax the tests a bit further by using the *-DAG check directive. The test will still check that each pattern appears, but will no longer require the patterns to appear in a sequential order.

Oh, so DAG vs DAG-NEXT, right?

LGTM. Thanks.

dnovillo accepted this revision.Apr 26 2017, 8:51 AM
This revision was automatically updated to reflect the committed changes.