mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Merge pull request #1 from geoffw0/assignadd
CPP: Tests for: Better overflow detection for AssignAdd/AssignSub
This commit is contained in:
@@ -423,6 +423,23 @@
|
||||
| test.c:398:22:398:22 | y | 5.0 |
|
||||
| test.c:399:10:399:11 | y1 | 1.0 |
|
||||
| test.c:399:15:399:16 | y2 | 5.0 |
|
||||
| test.c:407:3:407:3 | i | -2.147483648E9 |
|
||||
| test.c:408:7:408:7 | i | 10.0 |
|
||||
| test.c:410:3:410:3 | i | -2.147483648E9 |
|
||||
| test.c:411:3:411:3 | i | 10.0 |
|
||||
| test.c:412:7:412:7 | i | -2.147483648E9 |
|
||||
| test.c:414:3:414:3 | i | -2.147483648E9 |
|
||||
| test.c:415:3:415:3 | i | 40.0 |
|
||||
| test.c:416:7:416:7 | i | -2.147483648E9 |
|
||||
| test.c:418:3:418:3 | i | -2.147483648E9 |
|
||||
| test.c:418:7:418:7 | j | -2.147483648E9 |
|
||||
| test.c:419:7:419:7 | i | 40.0 |
|
||||
| test.c:421:3:421:3 | i | -2.147483648E9 |
|
||||
| test.c:421:8:421:8 | j | 40.0 |
|
||||
| test.c:422:7:422:7 | i | 50.0 |
|
||||
| test.c:424:3:424:3 | i | -2.147483648E9 |
|
||||
| test.c:424:13:424:13 | j | -2.147483648E9 |
|
||||
| test.c:425:7:425:7 | i | -2.147483648E9 |
|
||||
| test.cpp:10:7:10:7 | b | -2.147483648E9 |
|
||||
| test.cpp:11:5:11:5 | x | -2.147483648E9 |
|
||||
| test.cpp:13:10:13:10 | x | -2.147483648E9 |
|
||||
|
||||
@@ -398,3 +398,29 @@ unsigned int test_comma01(unsigned int x) {
|
||||
y2 = (y++, y += 3, y);
|
||||
return y1 + y2;
|
||||
}
|
||||
|
||||
void out(int i);
|
||||
|
||||
void test17() {
|
||||
int i, j;
|
||||
|
||||
i = 10;
|
||||
out(i); // 10
|
||||
|
||||
i = 10;
|
||||
i += 10;
|
||||
out(i); // 20
|
||||
|
||||
i = 40;
|
||||
i -= 10;
|
||||
out(i); // 30
|
||||
|
||||
i = j = 40;
|
||||
out(i); // 40
|
||||
|
||||
i = (j += 10);
|
||||
out(i); // 50
|
||||
|
||||
i = 20 + (j -= 10);
|
||||
out(i); // 60
|
||||
}
|
||||
|
||||
@@ -423,6 +423,23 @@
|
||||
| test.c:398:22:398:22 | y | 105.0 |
|
||||
| test.c:399:10:399:11 | y1 | 101.0 |
|
||||
| test.c:399:15:399:16 | y2 | 105.0 |
|
||||
| test.c:407:3:407:3 | i | 2.147483647E9 |
|
||||
| test.c:408:7:408:7 | i | 10.0 |
|
||||
| test.c:410:3:410:3 | i | 2.147483647E9 |
|
||||
| test.c:411:3:411:3 | i | 10.0 |
|
||||
| test.c:412:7:412:7 | i | 2.147483647E9 |
|
||||
| test.c:414:3:414:3 | i | 2.147483647E9 |
|
||||
| test.c:415:3:415:3 | i | 40.0 |
|
||||
| test.c:416:7:416:7 | i | 2.147483647E9 |
|
||||
| test.c:418:3:418:3 | i | 2.147483647E9 |
|
||||
| test.c:418:7:418:7 | j | 2.147483647E9 |
|
||||
| test.c:419:7:419:7 | i | 40.0 |
|
||||
| test.c:421:3:421:3 | i | 2.147483647E9 |
|
||||
| test.c:421:8:421:8 | j | 40.0 |
|
||||
| test.c:422:7:422:7 | i | 50.0 |
|
||||
| test.c:424:3:424:3 | i | 2.147483647E9 |
|
||||
| test.c:424:13:424:13 | j | 2.147483647E9 |
|
||||
| test.c:425:7:425:7 | i | 2.147483647E9 |
|
||||
| test.cpp:10:7:10:7 | b | 2.147483647E9 |
|
||||
| test.cpp:11:5:11:5 | x | 2.147483647E9 |
|
||||
| test.cpp:13:10:13:10 | x | 2.147483647E9 |
|
||||
|
||||
Reference in New Issue
Block a user