[PATCH] D60778: Make precompiled headers reproducible by switching OpenCL extension to std::map

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 17 08:54:55 PDT 2019

Anastasia added a comment.

In D60778#1470176 <https://reviews.llvm.org/D60778#1470176>, @lebedev.ri wrote:

> In D60778#1470152 <https://reviews.llvm.org/D60778#1470152>, @Anastasia wrote:
> > In D60778#1468825 <https://reviews.llvm.org/D60778#1468825>, @lebedev.ri wrote:
> >
> > > > Not sure how to test this though? I guess we can trust that std::map is always sorted just as it says in its description.
> > >
> > > You could add a test that contains several entries in `OpenCLTypeExtMap` and several entries in `OpenCLDeclExtMap`.
> > >  In that test, write te PCH, and then apply `llvm-bcanalyzer` to that PCH. It should dump it the bitcode in textual dump.
> > >  And then simply apply FileCheck to that textual dump, with CHECK lines requiring the specific order of these entries.
> > >  If the order is not deterministic in PCH, then that test would (should!) fail sporadically.
> > >  At least that is my guess.
> >
> >
> > Ok I could do that, but I guess it can then fail on the commits that didn't actually trigger the issue. Would it not be a problem?
> Why would it fail if this fixes the issue?

But once something is changed and it's no longer deterministic, we might not be able to detect this necessarily on the offending commit with such test?

> Re randomness - see https://reviews.llvm.org/D59401#change-QMkBH7328Dyv



More information about the cfe-commits mailing list