File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
cpp/ql/test/library-tests/rangeanalysis/SimpleRangeAnalysis Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 599
599
| test.c:675:7:675:7 | y | -2147483648 |
600
600
| test.c:684:7:684:7 | x | -2147483648 |
601
601
| test.c:689:7:689:7 | x | -2147483648 |
602
+ | test.c:696:8:696:8 | x | 2147483647 |
603
+ | test.c:696:12:696:12 | y | 256 |
604
+ | test.c:697:9:697:9 | x | 2147483647 |
605
+ | test.c:698:9:698:9 | y | 256 |
602
606
| test.cpp:10:7:10:7 | b | -2147483648 |
603
607
| test.cpp:11:5:11:5 | x | -2147483648 |
604
608
| test.cpp:13:10:13:10 | x | -2147483648 |
Original file line number Diff line number Diff line change @@ -689,3 +689,12 @@ void test(int x) {
689
689
out (x );
690
690
goto label ;
691
691
}
692
+
693
+ void test_overflow () {
694
+ const int x = 2147483647 ; // 2^31-1
695
+ const int y = 256 ;
696
+ if ((x + y ) <= 512 ) {
697
+ out (x );
698
+ out (y );
699
+ }
700
+ }
Original file line number Diff line number Diff line change 599
599
| test.c:675:7:675:7 | y | 2147483647 |
600
600
| test.c:684:7:684:7 | x | 2147483647 |
601
601
| test.c:689:7:689:7 | x | 15 |
602
+ | test.c:696:8:696:8 | x | 2147483647 |
603
+ | test.c:696:12:696:12 | y | 256 |
604
+ | test.c:697:9:697:9 | x | 256 |
605
+ | test.c:698:9:698:9 | y | -2147483135 |
602
606
| test.cpp:10:7:10:7 | b | 2147483647 |
603
607
| test.cpp:11:5:11:5 | x | 2147483647 |
604
608
| test.cpp:13:10:13:10 | x | 2147483647 |
You can’t perform that action at this time.
0 commit comments