The tests all check that the resultant MIR debug instructions look right when using SelectionDAG with AssignmentTrackingAnalysis.
Notes
I've bundled the tests together because the "core", "redundant removal", and "fragment fill" parts of the pass were not written in isolation as they are presented. I suppose the tests could be separated out into the patches if D136331 is applied before D136321 and D136325, but some disentangling will be required so it is my preference to keep them bundled if possible.
Maybe there is a better way to test the analysis that doesn't rely on something interpreting the results? OTOH, we do also want to be sure the results are being interpreted sensibly.
I'm definitely open to adding more tests if anyone has any suggestions.
What would happen if non-constants were used, but there were no out-of-block users? The reason being that today we can recover variable locations that are coincidentally PHI'd correctly due to being in the right registers, even if there isn't an IR PHI happening and being used. But that won't happen if an explicit DBG_VALUE $noreg is produced at the merge point.