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) {
134
134
struct X { int n; };
135
135
void read_argument (const X *);
136
136
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.
137
143
void nonterminating_without_operands_as_ssa (X *x) {
138
144
read_argument (x);
139
145
while (x->n ) {
You can’t perform that action at this time.
0 commit comments