Skip to content

Commit 4cb5bea

Browse files
committed
C++: Add simple negation test cases.
1 parent bdad847 commit 4cb5bea

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cpp/ql/test/library-tests/ir/range-analysis/SimpleRangeAnalysis_tests.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,3 +997,15 @@ void test_overflow() {
997997
range(x + y); // $ range===-2147483393
998998
}
999999
}
1000+
1001+
void test_negate_unsigned(unsigned u) {
1002+
if(10 < u && u < 20) {
1003+
range<unsigned>(-u); // underflows
1004+
}
1005+
}
1006+
1007+
void test_negate_signed(int s) {
1008+
if(10 < s && s < 20) {
1009+
range<int>(-s); // $ MISSING: range=<=-11 range=>=-19
1010+
}
1011+
}

0 commit comments

Comments
 (0)