File tree Expand file tree Collapse file tree 5 files changed +25
-0
lines changed
cpp/ql/test/library-tests/controlflow/guards Expand file tree Collapse file tree 5 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 4949| test.cpp:135:6:135:21 | call to __builtin_expect |
5050| test.cpp:141:6:141:21 | call to __builtin_expect |
5151| test.cpp:145:6:145:21 | call to __builtin_expect |
52+ | test.cpp:151:6:151:14 | ! ... |
53+ | test.cpp:151:8:151:13 | ... + ... |
Original file line number Diff line number Diff line change 267267| 146 | x != 0 when ! ... is false |
268268| 146 | x != 0 when x is true |
269269| 146 | x == 0 when x is false |
270+ | 151 | ! ... != 0 when ! ... is true |
271+ | 151 | ! ... == 0 when ! ... is false |
272+ | 151 | ... + ... != 0 when ! ... is false |
273+ | 151 | ... + ... != 0 when ... + ... is true |
274+ | 151 | ... + ... == 0 when ! ... is true |
275+ | 151 | ... + ... == 0 when ... + ... is false |
276+ | 151 | a != -10 when ! ... is false |
277+ | 151 | a != -10 when ... + ... is true |
278+ | 151 | a == -10 when ! ... is true |
279+ | 151 | a == -10 when ... + ... is false |
270280| 152 | p != 0 when p is true |
271281| 152 | p == 0 when p is false |
272282| 158 | ! ... != 0 when ! ... is true |
Original file line number Diff line number Diff line change 108108| test.cpp:135:6:135:21 | call to __builtin_expect | true | 135 | 136 |
109109| test.cpp:141:6:141:21 | call to __builtin_expect | true | 141 | 142 |
110110| test.cpp:145:6:145:21 | call to __builtin_expect | true | 145 | 146 |
111+ | test.cpp:151:6:151:14 | ! ... | true | 151 | 152 |
112+ | test.cpp:151:8:151:13 | ... + ... | false | 151 | 152 |
Original file line number Diff line number Diff line change @@ -399,3 +399,8 @@ unary
399399| test.cpp:145:6:145:21 | call to __builtin_expect | test.cpp:145:6:145:21 | call to __builtin_expect | != | 0 | 145 | 146 |
400400| test.cpp:145:6:145:21 | call to __builtin_expect | test.cpp:145:23:145:23 | a | != | 42 | 145 | 146 |
401401| test.cpp:145:6:145:21 | call to __builtin_expect | test.cpp:145:23:145:29 | ... != ... | != | 0 | 145 | 146 |
402+ | test.cpp:151:6:151:14 | ! ... | test.cpp:151:6:151:14 | ! ... | != | 0 | 151 | 152 |
403+ | test.cpp:151:6:151:14 | ! ... | test.cpp:151:8:151:8 | a | == | -10 | 151 | 152 |
404+ | test.cpp:151:6:151:14 | ! ... | test.cpp:151:8:151:13 | ... + ... | == | 0 | 151 | 152 |
405+ | test.cpp:151:8:151:13 | ... + ... | test.cpp:151:8:151:8 | a | == | -10 | 151 | 152 |
406+ | test.cpp:151:8:151:13 | ... + ... | test.cpp:151:8:151:13 | ... + ... | == | 0 | 151 | 152 |
Original file line number Diff line number Diff line change @@ -145,4 +145,10 @@ void unary_test_builtin_expected(int a) {
145145 if (__builtin_expect (a != 42 , 0 )) {
146146 use (a);
147147 }
148+ }
149+
150+ void addition_and_negation (int a) {
151+ if (!(a + 10 )) {
152+ use (a); // a is -10 here
153+ }
148154}
You can’t perform that action at this time.
0 commit comments