File tree Expand file tree Collapse file tree 5 files changed +47
-1
lines changed
cpp/ql/test/library-tests/controlflow/guards Expand file tree Collapse file tree 5 files changed +47
-1
lines changed Original file line number Diff line number Diff line change 32
32
| test.cpp:61:10:61:10 | i |
33
33
| test.cpp:74:10:74:10 | i |
34
34
| test.cpp:84:10:84:10 | i |
35
+ | test.cpp:93:6:93:6 | c |
36
+ | test.cpp:99:6:99:6 | f |
37
+ | test.cpp:105:6:105:14 | ... != ... |
38
+ | test.cpp:111:6:111:14 | ... != ... |
Original file line number Diff line number Diff line change 119
119
| 102 | j < 10+0 when ... < ... is true |
120
120
| 102 | j >= 10 when ... < ... is false |
121
121
| 102 | j >= 10+0 when ... < ... is false |
122
+ | 105 | 0.0 != f+0 when ... != ... is true |
123
+ | 105 | 0.0 == f+0 when ... != ... is false |
124
+ | 105 | f != 0.0+0 when ... != ... is true |
125
+ | 105 | f == 0.0+0 when ... != ... is false |
122
126
| 109 | 0 != x+0 when ... == ... is false |
123
127
| 109 | 0 != x+0 when ... \|\| ... is false |
124
128
| 109 | 0 < y+1 when ... < ... is false |
137
141
| 109 | y >= 0 when ... \|\| ... is false |
138
142
| 109 | y >= 0+0 when ... < ... is false |
139
143
| 109 | y >= 0+0 when ... \|\| ... is false |
144
+ | 111 | 0.0 != i+0 when ... != ... is true |
145
+ | 111 | 0.0 == i+0 when ... != ... is false |
146
+ | 111 | i != 0.0+0 when ... != ... is true |
147
+ | 111 | i == 0.0+0 when ... != ... is false |
Original file line number Diff line number Diff line change 90
90
| test.cpp:61:10:61:10 | i | Case[1] | 65 | 66 |
91
91
| test.cpp:74:10:74:10 | i | Case[0..10] | 75 | 77 |
92
92
| test.cpp:74:10:74:10 | i | Case[11..20] | 78 | 79 |
93
+ | test.cpp:93:6:93:6 | c | true | 93 | 94 |
94
+ | test.cpp:99:6:99:6 | f | true | 99 | 100 |
95
+ | test.cpp:105:6:105:14 | ... != ... | true | 105 | 106 |
96
+ | test.cpp:111:6:111:14 | ... != ... | true | 111 | 112 |
Original file line number Diff line number Diff line change @@ -155,6 +155,10 @@ binary
155
155
| test.cpp:31:7:31:13 | ... == ... | test.cpp:31:12:31:13 | - ... | != | test.cpp:31:7:31:7 | x | 0 | 34 | 34 |
156
156
| test.cpp:31:7:31:13 | ... == ... | test.cpp:31:12:31:13 | - ... | == | test.cpp:31:7:31:7 | x | 0 | 30 | 30 |
157
157
| test.cpp:31:7:31:13 | ... == ... | test.cpp:31:12:31:13 | - ... | == | test.cpp:31:7:31:7 | x | 0 | 31 | 32 |
158
+ | test.cpp:105:6:105:14 | ... != ... | test.cpp:105:6:105:6 | f | != | test.cpp:105:11:105:14 | 0.0 | 0 | 105 | 106 |
159
+ | test.cpp:105:6:105:14 | ... != ... | test.cpp:105:11:105:14 | 0.0 | != | test.cpp:105:6:105:6 | f | 0 | 105 | 106 |
160
+ | test.cpp:111:6:111:14 | ... != ... | test.cpp:111:6:111:6 | i | != | test.cpp:111:11:111:14 | 0.0 | 0 | 111 | 112 |
161
+ | test.cpp:111:6:111:14 | ... != ... | test.cpp:111:11:111:14 | 0.0 | != | test.cpp:111:6:111:6 | i | 0 | 111 | 112 |
158
162
unary
159
163
| test.c:7:9:7:13 | ... > ... | test.c:7:9:7:9 | x | < | 1 | 10 | 11 |
160
164
| test.c:7:9:7:13 | ... > ... | test.c:7:9:7:9 | x | >= | 1 | 7 | 9 |
Original file line number Diff line number Diff line change @@ -85,4 +85,30 @@ void test_switches_default(int i) {
85
85
default :
86
86
use1 (i);
87
87
}
88
- }
88
+ }
89
+
90
+ void use (...);
91
+
92
+ void pointer_comparison (char * c) {
93
+ if (c) {
94
+ use (c);
95
+ }
96
+ }
97
+
98
+ void implicit_float_comparison (float f) {
99
+ if (f) {
100
+ use (f);
101
+ }
102
+ }
103
+
104
+ void explicit_float_comparison (float f) {
105
+ if (f != 0 .0f ) {
106
+ use (f);
107
+ }
108
+ }
109
+
110
+ void int_float_comparison (int i) {
111
+ if (i != 0 .0f ) {
112
+ use (i);
113
+ }
114
+ }
You can’t perform that action at this time.
0 commit comments