One of Guard Widening tests is not checking what it is supposed to check and
is based on flaky logic. Guard widening algorithm relies on PDT. The outer loop
is infinite, therefore no post-domination tree exists. According to the algorithm,
we should only widen if there is post-domination between two guards. This test is
based on two flaky facts regarding the PDT:
- PDT must choose the furthest block as its non-trivial root for infinite loops;
- PDT must know nothing about implicit control flow of guards.
When the guards are turned into equivalent form of widenable branches, both these
facts break and widening becomes illegal. So it makes sense to fix the test to make
it more robust.
This patch alters the test so that it checks what it is supposed to check. Now it
has 2 loops and checks the widening scenario described in the comment.