C++: Add a guard condition test with an example of a negated less-than relation.

This commit is contained in:
Mathias Vorreiter Pedersen
2025-01-16 14:57:08 +00:00
parent 2076c1c51f
commit 00a1978b0c
5 changed files with 28 additions and 0 deletions

View File

@@ -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 |

View File

@@ -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 |

View File

@@ -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 |

View File

@@ -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 |

View File

@@ -169,5 +169,11 @@ void test8(short s) {
void test9(short s) {
if(!s) {
}
}
void test10(int a, int b) {
if(!(a < b)) {
}
}