-
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
- Improved the JSON format.
- Now the message is a multi-line string properly JSON-spaced.
Not sure what causes the nondeterministic CHECKs, but sometimes it writes out
"a->b: moved", "a: moved" instead of the logical order: "a: moved", a->b: moved",
so that it could match the wrong line.
I do not know why we prints out two states at one point in one File-check run.
It looks like that:
"program_state": { "store": [ { "cluster": "a", "items": [ { "kind": "Default", "offset": 128, "value": "0 S8b" }, { "kind": "Direct", "offset": 0, "value": "42 S32b" }, { "kind": "Direct", "offset": 64, "value": "Unknown" }, ]}, ], "environment": [ { "location_context": "#0 Call", "calling": "simpleMoveCtorTest", "call_line": null, "items": [ { "lctx_id": 1008, "stmt_id": 37353, "pretty": "clang_analyzer_printState", "value": "&code{clang_analyzer_printState}" }, ]}, ], "constraints": null, "dynamic_types": null, "constructing_objects": null, "checker_messages": [ { "checker": "cplusplus.Move", "messages": [ "Moved-from objects :", "a: moved", "a->b: moved", "", ]}, ], } "program_state": { "store": [ { "cluster": "a", "items": [ { "kind": "Default", "offset": 128, "value": "0 S8b" }, { "kind": "Direct", "offset": 0, "value": "42 S32b" }, { "kind": "Direct", "offset": 64, "value": "Unknown" }, ]}, ], "environment": [ { "location_context": "#0 Call", "calling": "simpleMoveCtorTest", "call_line": null, "items": [ { "lctx_id": 621, "stmt_id": 37353, "pretty": "clang_analyzer_printState", "value": "&code{clang_analyzer_printState}" }, ]}, ], "constraints": null, "dynamic_types": null, "constructing_objects": null, "checker_messages": [ { "checker": "cplusplus.Move", "messages": [ "Moved-from objects :", "a->b: moved", "a: moved", "", ]}, ], }
These prints are different across runs, but same across different states on the same run, right? That's kinda expected because the map is ordered by pointer values internally, which may change across runs. This is not that bad of a non-determinism, i don't think it's worth fixing. Let's test a single line to make sure the test definitely doesn't test the order (i.e., leave only a->b or only a) and then commit!
So that two printState() dumps are only one test-RUN, which is the new one. Because there are two entries of printState() it is 50% to pass the test as it sometimes catches the other printState() and that is why a->b: moved cannot be set to the first, nor a: moved. It would be cool to allow only one printState() somehow.
I mean, let's remove one of the lines from the test so that it became deterministic and commit and then polish later.