Skip to content

Commit 6c44b0e

Browse files
committed
C++: Add test case where a guarded block has two predecessors which are both in the dominance domain of the guard
1 parent f91bd91 commit 6c44b0e

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/lowerBound.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,8 @@
597597
| test.c:670:7:670:7 | x | -2147483648 |
598598
| test.c:671:9:671:9 | y | -2147483648 |
599599
| test.c:675:7:675:7 | y | -2147483648 |
600+
| test.c:684:7:684:7 | x | -2147483648 |
601+
| test.c:689:7:689:7 | x | -2147483648 |
600602
| test.cpp:10:7:10:7 | b | -2147483648 |
601603
| test.cpp:11:5:11:5 | x | -2147483648 |
602604
| test.cpp:13:10:13:10 | x | -2147483648 |

cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/test.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,3 +679,13 @@ void guard_with_exit(int x, int y) {
679679
// The RangeSsa will place guardPhy on `out(y)`, and consequently there is no
680680
// frontier phi node at out(y).
681681
}
682+
683+
void test(int x) {
684+
if (x >= 10) {
685+
return;
686+
}
687+
// The basic below has two predecessors.
688+
label:
689+
out(x);
690+
goto label;
691+
}

cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis/upperBound.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,8 @@
597597
| test.c:670:7:670:7 | x | 2147483647 |
598598
| test.c:671:9:671:9 | y | 2147483647 |
599599
| test.c:675:7:675:7 | y | 2147483647 |
600+
| test.c:684:7:684:7 | x | 2147483647 |
601+
| test.c:689:7:689:7 | x | 9 |
600602
| test.cpp:10:7:10:7 | b | 2147483647 |
601603
| test.cpp:11:5:11:5 | x | 2147483647 |
602604
| test.cpp:13:10:13:10 | x | 2147483647 |

0 commit comments

Comments
 (0)