Sort the elements of Sema::OpenCLTypeExtMap and Sema::OpenCLDeclExtMap by TypeIDs and DeclIDs to guarantee a stable serialization order.
Details
Diff Detail
- Repository
- rC Clang
Event Timeline
By the way, I am wondering about how much this is tested. I did look quickly in test/PCH and it appears that there are only 3 (short) tests : ocl_types.cl, opencl-extensions.cl and no-validate-pch.
This is tested in test/SemaOpenCL/extension-begin.cl: https://reviews.llvm.org/D53200
The ordering in PCH isn't tested anywhere however, but I am not clear how to check for nondeterminism properly. Because the fact that the same output is generated N times won't guarantee that it's the same N+1 times. Especially I do believe it's likely on the same revision the same output to be produced but it's less likely across revisions. :(
We could still go for something like the following but accept that some a random failure might happen not necessarily on a commit that introduces it?
Ah I see, I did indeed miss that.
The ordering in PCH isn't tested anywhere however, but I am not clear how to check for nondeterminism properly. Because the fact that the same output is generated N times won't guarantee that it's the same N+1 times. Especially I do believe it's likely on the same revision the same output to be produced but it's less likely across revisions. :(
We could still go for something like the following but accept that some a random failure might happen not necessarily on a commit that introduces it?
I am not sure that this is needed. Non-deterministic tests are really annoying.
We could still go for something like the following but accept that some a random failure might happen not necessarily on a commit that introduces it?
I am not sure that this is needed. Non-deterministic tests are really annoying.
Yes. I think this might be a wider topic to address if we happen to have more issues of this kind.