mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C++: Add a guard condition test with an example of a negated less-than relation.
This commit is contained in:
@@ -32,6 +32,8 @@
|
||||
| test.c:164:8:164:8 | s |
|
||||
| test.c:170:8:170:9 | ! ... |
|
||||
| test.c:170:9:170:9 | s |
|
||||
| test.c:176:8:176:15 | ! ... |
|
||||
| test.c:176:10:176:14 | ... < ... |
|
||||
| test.cpp:18:8:18:10 | call to get |
|
||||
| test.cpp:31:7:31:13 | ... == ... |
|
||||
| test.cpp:42:13:42:20 | call to getABool |
|
||||
|
||||
@@ -381,3 +381,15 @@
|
||||
| 170 | s != 0 when s is true |
|
||||
| 170 | s == 0 when ! ... is true |
|
||||
| 170 | s == 0 when s is false |
|
||||
| 176 | ! ... != 0 when ! ... is true |
|
||||
| 176 | ! ... != 0 when ... < ... is false |
|
||||
| 176 | ! ... != 1 when ! ... is false |
|
||||
| 176 | ! ... != 1 when ... < ... is true |
|
||||
| 176 | ! ... == 0 when ! ... is false |
|
||||
| 176 | ! ... == 0 when ... < ... is true |
|
||||
| 176 | ! ... == 1 when ! ... is true |
|
||||
| 176 | ! ... == 1 when ... < ... is false |
|
||||
| 176 | ... < ... != 0 when ! ... is false |
|
||||
| 176 | ... < ... != 0 when ... < ... is true |
|
||||
| 176 | ... < ... == 0 when ! ... is true |
|
||||
| 176 | ... < ... == 0 when ... < ... is false |
|
||||
|
||||
@@ -85,6 +85,8 @@
|
||||
| test.c:164:8:164:8 | s | true | 164 | 166 |
|
||||
| test.c:170:8:170:9 | ! ... | true | 170 | 172 |
|
||||
| test.c:170:9:170:9 | s | false | 170 | 172 |
|
||||
| test.c:176:8:176:15 | ! ... | true | 176 | 178 |
|
||||
| test.c:176:10:176:14 | ... < ... | false | 176 | 178 |
|
||||
| test.cpp:18:8:18:10 | call to get | true | 19 | 19 |
|
||||
| test.cpp:31:7:31:13 | ... == ... | false | 30 | 30 |
|
||||
| test.cpp:31:7:31:13 | ... == ... | false | 34 | 34 |
|
||||
|
||||
@@ -461,6 +461,12 @@ unary
|
||||
| test.c:170:9:170:9 | s | test.c:170:8:170:9 | ! ... | != | 0 | 170 | 172 |
|
||||
| test.c:170:9:170:9 | s | test.c:170:8:170:9 | ! ... | == | 1 | 170 | 172 |
|
||||
| test.c:170:9:170:9 | s | test.c:170:9:170:9 | s | == | 0 | 170 | 172 |
|
||||
| test.c:176:8:176:15 | ! ... | test.c:176:8:176:15 | ! ... | != | 0 | 176 | 178 |
|
||||
| test.c:176:8:176:15 | ! ... | test.c:176:8:176:15 | ! ... | == | 1 | 176 | 178 |
|
||||
| test.c:176:8:176:15 | ! ... | test.c:176:10:176:14 | ... < ... | == | 0 | 176 | 178 |
|
||||
| test.c:176:10:176:14 | ... < ... | test.c:176:8:176:15 | ! ... | != | 0 | 176 | 178 |
|
||||
| test.c:176:10:176:14 | ... < ... | test.c:176:8:176:15 | ! ... | == | 1 | 176 | 178 |
|
||||
| test.c:176:10:176:14 | ... < ... | test.c:176:10:176:14 | ... < ... | == | 0 | 176 | 178 |
|
||||
| test.cpp:18:8:18:10 | call to get | test.cpp:18:8:18:10 | call to get | != | 0 | 19 | 19 |
|
||||
| test.cpp:18:8:18:10 | call to get | test.cpp:18:8:18:10 | call to get | == | 1 | 19 | 19 |
|
||||
| test.cpp:31:7:31:13 | ... == ... | test.cpp:31:7:31:7 | x | != | -1 | 30 | 30 |
|
||||
|
||||
@@ -169,5 +169,11 @@ void test8(short s) {
|
||||
void test9(short s) {
|
||||
if(!s) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void test10(int a, int b) {
|
||||
if(!(a < b)) {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user