Skip to content

Commit dc2eea5

Browse files
committed
C++: Add buggy testcase with 'RemExpr'.
1 parent 04244b3 commit dc2eea5

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-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
@@ -592,6 +592,8 @@
592592
| test.c:654:9:654:9 | i | -2147483648 |
593593
| test.c:658:7:658:7 | u | 0 |
594594
| test.c:659:9:659:9 | u | 0 |
595+
| test.c:664:12:664:12 | s | -2147483648 |
596+
| test.c:665:7:665:8 | s2 | -2147483648 |
595597
| test.cpp:10:7:10:7 | b | -2147483648 |
596598
| test.cpp:11:5:11:5 | x | -2147483648 |
597599
| test.cpp:13:10:13:10 | x | -2147483648 |

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,3 +659,8 @@ void guard_bound_out_of_range(void) {
659659
out(u); // unreachable [BUG: is 0 .. +max]
660660
}
661661
}
662+
663+
void test_mod(int s) {
664+
int s2 = s % 5;
665+
out(s2); // -4 .. 4 [BUG: is -max .. max]
666+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,8 @@
592592
| test.c:654:9:654:9 | i | 2147483647 |
593593
| test.c:658:7:658:7 | u | 0 |
594594
| test.c:659:9:659:9 | u | 4294967295 |
595+
| test.c:664:12:664:12 | s | 2147483647 |
596+
| test.c:665:7:665:8 | s2 | 2147483647 |
595597
| test.cpp:10:7:10:7 | b | 2147483647 |
596598
| test.cpp:11:5:11:5 | x | 2147483647 |
597599
| test.cpp:13:10:13:10 | x | 2147483647 |

0 commit comments

Comments
 (0)