Skip to content

Commit

Permalink
Merge pull request #14714 from MathiasVP/geoffw0-follow-up-comment
Browse files Browse the repository at this point in the history
C++: Add comment to testcase
  • Loading branch information
MathiasVP authored Nov 7, 2023
2 parents 2787f0a + 1c8f474 commit 5a9867c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cpp/ql/test/library-tests/ir/range-analysis/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ void test_div(int x) {
struct X { int n; };
void read_argument(const X *);

// This test exists purely to ensure that modulus analysis terminates in the
// presence of inexact phi operands. The LoadInstruction on `while(x->n) { ... }`
// reads from a PhiInstruction with two input operands: an exact operand defined
// by the StoreInstruction generated by `x->n--` and an inexact operand coming
// from the WriteSideEffect generated by `read_argument(x)`. If we don't consider
// the inexact operand modulus analysis fails to terminate.
void nonterminating_without_operands_as_ssa(X *x) {
read_argument(x);
while (x->n) {
Expand Down

0 comments on commit 5a9867c

Please sign in to comment.