File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
cpp/ql/test/library-tests/ir/range-analysis Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,12 @@ void test_div(int x) {
134134struct X { int n; };
135135void read_argument (const X *);
136136
137+ // This test exists purely to ensure that modulus analysis terminates in the
138+ // presence of inexact phi operands. The LoadInstruction on `while(x->n) { ... }`
139+ // reads from a PhiInstruction with two input operands: an exact operand defined
140+ // by the StoreInstruction generated by `x->n--` and an inexact operand coming
141+ // from the WriteSideEffect generated by `read_argument(x)`. If we don't consider
142+ // the inexact operand modulus analysis fails to terminate.
137143void nonterminating_without_operands_as_ssa (X *x) {
138144 read_argument (x);
139145 while (x->n ) {
You can’t perform that action at this time.
0 commit comments