Skip to content

Commit a25cc2d

Browse files
committed
C++: Accept range-analysis test results
1 parent a4cb774 commit a25cc2d

File tree

1 file changed

+4
-4
lines changed
  • cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,19 +83,19 @@ int ref_to_number(int &i, const int &ci, int &aliased) {
8383
int &alias = aliased; // no range analysis for either of the two aliased variables
8484

8585
if (i >= 2)
86-
return i; // BUG: lower bound should be 2
86+
return i;
8787

8888
if (ci >= 2)
89-
return ci; // BUG: lower bound should be 2
89+
return ci;
9090

9191
if (aliased >= 2)
9292
return aliased;
9393

9494
if (alias >= 2)
9595
return alias;
9696

97-
for (; i <= 12345; i++) {
98-
i; // BUG: upper bound should be deduced (but subject to widening)
97+
for (; i <= 12345; i++) { // test that widening works for references
98+
i;
9999
}
100100

101101
return 0;

0 commit comments

Comments
 (0)