Argyrios Kyrtzidis | 2d67b90 | 2011-02-17 21:39:39 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCFG -cfg-add-implicit-dtors -cfg-add-initializers %s 2>&1 | FileCheck %s |
Marcin Swiderski | 8599e76 | 2010-11-03 06:19:35 +0000 | [diff] [blame] | 2 | // XPASS: * |
| 3 | |
| 4 | class A { |
| 5 | public: |
| 6 | A() {} |
| 7 | ~A() {} |
| 8 | |
| 9 | static A make() { return A(); } |
| 10 | |
| 11 | operator bool() { return false; } |
| 12 | operator int() { return 0; } |
| 13 | }; |
| 14 | |
| 15 | class B { |
| 16 | public: |
| 17 | B() {} |
| 18 | ~B() {} |
| 19 | |
| 20 | operator bool() { return true; } |
| 21 | operator int() { return 1; } |
| 22 | operator A() { return A(); } |
| 23 | }; |
| 24 | |
| 25 | void foo(int); |
| 26 | void foo(bool); |
| 27 | void foo(const A&); |
| 28 | |
| 29 | void test_binary() { |
| 30 | int a = int(A()) + int(B()); |
| 31 | foo(int(A()) + int(B())); |
| 32 | int b; |
| 33 | } |
| 34 | |
| 35 | void test_and() { |
| 36 | bool a = A() && B(); |
| 37 | foo(A() && B()); |
| 38 | int b; |
| 39 | } |
| 40 | |
| 41 | void test_or() { |
| 42 | bool a = A() || B(); |
| 43 | foo(A() || B()); |
| 44 | int b; |
| 45 | } |
| 46 | |
| 47 | void test_cond() { |
| 48 | A a = B() ? A() : A(B()); |
| 49 | if (B()) { foo(0); } else { foo(0); } |
| 50 | int b; |
| 51 | } |
| 52 | |
| 53 | void test_cond_cref() { |
| 54 | const A& a = B() ? A() : A(B()); |
| 55 | foo(B() ? A() : A(B())); |
| 56 | int b; |
| 57 | } |
| 58 | |
| 59 | void test_cond_implicit() { |
| 60 | A a = A() ?: A(); |
| 61 | int b; |
| 62 | } |
| 63 | |
| 64 | void test_cond_implicit_cref() { |
| 65 | const A& a = A() ?: A(); |
| 66 | foo(A() ?: A()); |
| 67 | int b; |
| 68 | } |
| 69 | |
| 70 | void test_copy_init() { |
| 71 | A a = A(); |
| 72 | int b; |
| 73 | } |
| 74 | |
| 75 | void test_cref_init() { |
| 76 | const A& a = A(); |
| 77 | foo(A()); |
| 78 | int b; |
| 79 | } |
| 80 | |
| 81 | void test_call_copy_init() { |
| 82 | A a = A::make(); |
| 83 | int b; |
| 84 | } |
| 85 | |
| 86 | void test_call_cref_init() { |
| 87 | const A& a = A::make(); |
| 88 | foo(A::make()); |
| 89 | int b; |
| 90 | } |
| 91 | |
| 92 | void test_assign() { |
| 93 | int a; |
| 94 | a = A(); |
| 95 | int b; |
| 96 | } |
| 97 | |
| 98 | class TestCtorInits { |
| 99 | int a; |
| 100 | int b; |
| 101 | public: |
| 102 | TestCtorInits(); |
| 103 | }; |
| 104 | |
| 105 | TestCtorInits::TestCtorInits() |
| 106 | : a(int(A()) + int(B())) |
| 107 | , b() {} |
| 108 | |
Ted Kremenek | 8829989 | 2011-07-28 23:07:59 +0000 | [diff] [blame] | 109 | // CHECK: [ B2 (ENTRY) ] |
| 110 | // CHECK: Predecessors (0): |
| 111 | // CHECK: Successors (1): B1 |
| 112 | // CHECK: [ B1 ] |
| 113 | // CHECK: 1: A() |
| 114 | // CHECK: 2: [B1.1] (BindTemporary) |
| 115 | // CHECK: 3: [B1.2].operator int |
| 116 | // CHECK: 4: [B1.3]() |
| 117 | // CHECK: 5: [B1.4] |
| 118 | // CHECK: 6: int([B1.5]) |
| 119 | // CHECK: 7: B() |
| 120 | // CHECK: 8: [B1.7] (BindTemporary) |
| 121 | // CHECK: 9: [B1.8].operator int |
| 122 | // CHECK: 10: [B1.9]() |
| 123 | // CHECK: 11: [B1.10] |
| 124 | // CHECK: 12: int([B1.11]) |
| 125 | // CHECK: 13: [B1.6] + [B1.12] |
| 126 | // CHECK: 14: int a = int(A().operator int()) + int(B().operator int()); |
| 127 | // CHECK: 15: ~B() (Temporary object destructor) |
| 128 | // CHECK: 16: ~A() (Temporary object destructor) |
| 129 | // CHECK: 17: A() |
| 130 | // CHECK: 18: [B1.17] (BindTemporary) |
| 131 | // CHECK: 19: [B1.18].operator int |
| 132 | // CHECK: 20: [B1.19]() |
| 133 | // CHECK: 21: [B1.20] |
| 134 | // CHECK: 22: int([B1.21]) |
| 135 | // CHECK: 23: B() |
| 136 | // CHECK: 24: [B1.23] (BindTemporary) |
| 137 | // CHECK: 25: [B1.24].operator int |
| 138 | // CHECK: 26: [B1.25]() |
| 139 | // CHECK: 27: [B1.26] |
| 140 | // CHECK: 28: int([B1.27]) |
| 141 | // CHECK: 29: [B1.22] + [B1.28] |
| 142 | // CHECK: 30: foo |
| 143 | // CHECK: 31: [B1.30] |
| 144 | // CHECK: 32: [B1.31]([B1.29]) |
| 145 | // CHECK: 33: ~B() (Temporary object destructor) |
| 146 | // CHECK: 34: ~A() (Temporary object destructor) |
| 147 | // CHECK: 35: int b; |
| 148 | // CHECK: Predecessors (1): B2 |
| 149 | // CHECK: Successors (1): B0 |
| 150 | // CHECK: [ B0 (EXIT) ] |
| 151 | // CHECK: Predecessors (1): B1 |
| 152 | // CHECK: Successors (0): |
| 153 | // CHECK: [ B10 (ENTRY) ] |
| 154 | // CHECK: Predecessors (0): |
| 155 | // CHECK: Successors (1): B8 |
| 156 | // CHECK: [ B1 ] |
| 157 | // CHECK: 1: ~A() (Temporary object destructor) |
| 158 | // CHECK: 2: int b; |
| 159 | // CHECK: Predecessors (2): B2 B3 |
| 160 | // CHECK: Successors (1): B0 |
| 161 | // CHECK: [ B2 ] |
| 162 | // CHECK: 1: ~B() (Temporary object destructor) |
| 163 | // CHECK: Predecessors (1): B3 |
| 164 | // CHECK: Successors (1): B1 |
| 165 | // CHECK: [ B3 ] |
| 166 | // CHECK: 1: [B4.5] && [B5.4] |
| 167 | // CHECK: 2: foo |
| 168 | // CHECK: 3: [B3.2] |
| 169 | // CHECK: 4: [B3.3]([B3.1]) |
| 170 | // CHECK: T: [B4.5] && ... |
| 171 | // CHECK: Predecessors (2): B5 B4 |
| 172 | // CHECK: Successors (2): B2 B1 |
| 173 | // CHECK: [ B4 ] |
| 174 | // CHECK: 1: ~A() (Temporary object destructor) |
| 175 | // CHECK: 2: A() |
| 176 | // CHECK: 3: [B4.2] (BindTemporary) |
| 177 | // CHECK: 4: [B4.3].operator _Bool |
| 178 | // CHECK: 5: [B4.4]() |
| 179 | // CHECK: T: [B4.5] && ... |
| 180 | // CHECK: Predecessors (2): B6 B7 |
| 181 | // CHECK: Successors (2): B5 B3 |
| 182 | // CHECK: [ B5 ] |
| 183 | // CHECK: 1: B() |
| 184 | // CHECK: 2: [B5.1] (BindTemporary) |
| 185 | // CHECK: 3: [B5.2].operator _Bool |
| 186 | // CHECK: 4: [B5.3]() |
| 187 | // CHECK: Predecessors (1): B4 |
| 188 | // CHECK: Successors (1): B3 |
| 189 | // CHECK: [ B6 ] |
| 190 | // CHECK: 1: ~B() (Temporary object destructor) |
| 191 | // CHECK: Predecessors (1): B7 |
| 192 | // CHECK: Successors (1): B4 |
| 193 | // CHECK: [ B7 ] |
| 194 | // CHECK: 1: [B8.4] && [B9.4] |
| 195 | // CHECK: 2: bool a = A().operator _Bool() && B().operator _Bool(); |
| 196 | // CHECK: T: [B8.4] && ... |
| 197 | // CHECK: Predecessors (2): B9 B8 |
| 198 | // CHECK: Successors (2): B6 B4 |
| 199 | // CHECK: [ B8 ] |
| 200 | // CHECK: 1: A() |
| 201 | // CHECK: 2: [B8.1] (BindTemporary) |
| 202 | // CHECK: 3: [B8.2].operator _Bool |
| 203 | // CHECK: 4: [B8.3]() |
| 204 | // CHECK: T: [B8.4] && ... |
| 205 | // CHECK: Predecessors (1): B10 |
| 206 | // CHECK: Successors (2): B9 B7 |
| 207 | // CHECK: [ B9 ] |
| 208 | // CHECK: 1: B() |
| 209 | // CHECK: 2: [B9.1] (BindTemporary) |
| 210 | // CHECK: 3: [B9.2].operator _Bool |
| 211 | // CHECK: 4: [B9.3]() |
| 212 | // CHECK: Predecessors (1): B8 |
| 213 | // CHECK: Successors (1): B7 |
| 214 | // CHECK: [ B0 (EXIT) ] |
| 215 | // CHECK: Predecessors (1): B1 |
| 216 | // CHECK: Successors (0): |
| 217 | // CHECK: [ B10 (ENTRY) ] |
| 218 | // CHECK: Predecessors (0): |
| 219 | // CHECK: Successors (1): B8 |
| 220 | // CHECK: [ B1 ] |
| 221 | // CHECK: 1: ~A() (Temporary object destructor) |
| 222 | // CHECK: 2: int b; |
| 223 | // CHECK: Predecessors (2): B2 B3 |
| 224 | // CHECK: Successors (1): B0 |
| 225 | // CHECK: [ B2 ] |
| 226 | // CHECK: 1: ~B() (Temporary object destructor) |
| 227 | // CHECK: Predecessors (1): B3 |
| 228 | // CHECK: Successors (1): B1 |
| 229 | // CHECK: [ B3 ] |
| 230 | // CHECK: 1: [B4.5] || [B5.4] |
| 231 | // CHECK: 2: foo |
| 232 | // CHECK: 3: [B3.2] |
| 233 | // CHECK: 4: [B3.3]([B3.1]) |
| 234 | // CHECK: T: [B4.5] || ... |
| 235 | // CHECK: Predecessors (2): B5 B4 |
| 236 | // CHECK: Successors (2): B1 B2 |
| 237 | // CHECK: [ B4 ] |
| 238 | // CHECK: 1: ~A() (Temporary object destructor) |
| 239 | // CHECK: 2: A() |
| 240 | // CHECK: 3: [B4.2] (BindTemporary) |
| 241 | // CHECK: 4: [B4.3].operator _Bool |
| 242 | // CHECK: 5: [B4.4]() |
| 243 | // CHECK: T: [B4.5] || ... |
| 244 | // CHECK: Predecessors (2): B6 B7 |
| 245 | // CHECK: Successors (2): B3 B5 |
| 246 | // CHECK: [ B5 ] |
| 247 | // CHECK: 1: B() |
| 248 | // CHECK: 2: [B5.1] (BindTemporary) |
| 249 | // CHECK: 3: [B5.2].operator _Bool |
| 250 | // CHECK: 4: [B5.3]() |
| 251 | // CHECK: Predecessors (1): B4 |
| 252 | // CHECK: Successors (1): B3 |
| 253 | // CHECK: [ B6 ] |
| 254 | // CHECK: 1: ~B() (Temporary object destructor) |
| 255 | // CHECK: Predecessors (1): B7 |
| 256 | // CHECK: Successors (1): B4 |
| 257 | // CHECK: [ B7 ] |
| 258 | // CHECK: 1: [B8.4] || [B9.4] |
| 259 | // CHECK: 2: bool a = A().operator _Bool() || B().operator _Bool(); |
| 260 | // CHECK: T: [B8.4] || ... |
| 261 | // CHECK: Predecessors (2): B9 B8 |
| 262 | // CHECK: Successors (2): B4 B6 |
| 263 | // CHECK: [ B8 ] |
| 264 | // CHECK: 1: A() |
| 265 | // CHECK: 2: [B8.1] (BindTemporary) |
| 266 | // CHECK: 3: [B8.2].operator _Bool |
| 267 | // CHECK: 4: [B8.3]() |
| 268 | // CHECK: T: [B8.4] || ... |
| 269 | // CHECK: Predecessors (1): B10 |
| 270 | // CHECK: Successors (2): B7 B9 |
| 271 | // CHECK: [ B9 ] |
| 272 | // CHECK: 1: B() |
| 273 | // CHECK: 2: [B9.1] (BindTemporary) |
| 274 | // CHECK: 3: [B9.2].operator _Bool |
| 275 | // CHECK: 4: [B9.3]() |
| 276 | // CHECK: Predecessors (1): B8 |
| 277 | // CHECK: Successors (1): B7 |
| 278 | // CHECK: [ B0 (EXIT) ] |
| 279 | // CHECK: Predecessors (1): B1 |
| 280 | // CHECK: Successors (0): |
| 281 | // CHECK: [ B11 (ENTRY) ] |
| 282 | // CHECK: Predecessors (0): |
| 283 | // CHECK: Successors (1): B10 |
| 284 | // CHECK: [ B1 ] |
| 285 | // CHECK: 1: int b; |
| 286 | // CHECK: 2: [B7.4].~A() (Implicit destructor) |
| 287 | // CHECK: Predecessors (2): B2 B3 |
| 288 | // CHECK: Successors (1): B0 |
| 289 | // CHECK: [ B2 ] |
| 290 | // CHECK: 1: 0 |
| 291 | // CHECK: 2: foo |
| 292 | // CHECK: 3: [B2.2] |
| 293 | // CHECK: 4: [B2.3]([B2.1]) |
| 294 | // CHECK: Predecessors (1): B4 |
| 295 | // CHECK: Successors (1): B1 |
| 296 | // CHECK: [ B3 ] |
| 297 | // CHECK: 1: 0 |
| 298 | // CHECK: 2: foo |
| 299 | // CHECK: 3: [B3.2] |
| 300 | // CHECK: 4: [B3.3]([B3.1]) |
| 301 | // CHECK: Predecessors (1): B4 |
| 302 | // CHECK: Successors (1): B1 |
| 303 | // CHECK: [ B4 ] |
| 304 | // CHECK: 1: ~B() (Temporary object destructor) |
| 305 | // CHECK: 2: B() |
| 306 | // CHECK: 3: [B4.2] (BindTemporary) |
| 307 | // CHECK: 4: [B4.3].operator _Bool |
| 308 | // CHECK: 5: [B4.4]() |
| 309 | // CHECK: 6: ~B() (Temporary object destructor) |
| 310 | // CHECK: T: if [B4.5] |
| 311 | // CHECK: Predecessors (2): B5 B6 |
| 312 | // CHECK: Successors (2): B3 B2 |
| 313 | // CHECK: [ B5 ] |
| 314 | // CHECK: 1: ~A() (Temporary object destructor) |
| 315 | // CHECK: 2: ~A() (Temporary object destructor) |
| 316 | // CHECK: Predecessors (1): B7 |
| 317 | // CHECK: Successors (1): B4 |
| 318 | // CHECK: [ B6 ] |
| 319 | // CHECK: 1: ~A() (Temporary object destructor) |
| 320 | // CHECK: 2: ~A() (Temporary object destructor) |
| 321 | // CHECK: 3: ~A() (Temporary object destructor) |
| 322 | // CHECK: 4: ~B() (Temporary object destructor) |
| 323 | // CHECK: Predecessors (1): B7 |
| 324 | // CHECK: Successors (1): B4 |
| 325 | // CHECK: [ B7 ] |
| 326 | // CHECK: 1: [B10.4] ? [B8.5] : [B9.13] |
| 327 | // CHECK: 2: [B7.1] |
| 328 | // CHECK: 3: [B7.2] |
| 329 | // CHECK: 4: A a = B().operator _Bool() ? A() : A(B().operator A()); |
| 330 | // CHECK: T: [B10.4] ? ... : ... |
| 331 | // CHECK: Predecessors (2): B8 B9 |
| 332 | // CHECK: Successors (2): B5 B6 |
| 333 | // CHECK: [ B8 ] |
| 334 | // CHECK: 1: A() |
| 335 | // CHECK: 2: [B8.1] (BindTemporary) |
| 336 | // CHECK: 3: [B8.2] |
| 337 | // CHECK: 4: [B8.3] |
| 338 | // CHECK: 5: [B8.4] (BindTemporary) |
| 339 | // CHECK: Predecessors (1): B10 |
| 340 | // CHECK: Successors (1): B7 |
| 341 | // CHECK: [ B9 ] |
| 342 | // CHECK: 1: B() |
| 343 | // CHECK: 2: [B9.1] (BindTemporary) |
| 344 | // CHECK: 3: [B9.2].operator A |
| 345 | // CHECK: 4: [B9.3]() |
| 346 | // CHECK: 5: [B9.4] (BindTemporary) |
| 347 | // CHECK: 6: [B9.5] |
| 348 | // CHECK: 7: [B9.6] |
| 349 | // CHECK: 8: [B9.7] |
| 350 | // CHECK: 9: [B9.8] (BindTemporary) |
| 351 | // CHECK: 10: A([B9.9]) |
| 352 | // CHECK: 11: [B9.10] |
| 353 | // CHECK: 12: [B9.11] |
| 354 | // CHECK: 13: [B9.12] (BindTemporary) |
| 355 | // CHECK: Predecessors (1): B10 |
| 356 | // CHECK: Successors (1): B7 |
| 357 | // CHECK: [ B10 ] |
| 358 | // CHECK: 1: B() |
| 359 | // CHECK: 2: [B10.1] (BindTemporary) |
| 360 | // CHECK: 3: [B10.2].operator _Bool |
| 361 | // CHECK: 4: [B10.3]() |
| 362 | // CHECK: T: [B10.4] ? ... : ... |
| 363 | // CHECK: Predecessors (1): B11 |
| 364 | // CHECK: Successors (2): B8 B9 |
| 365 | // CHECK: [ B0 (EXIT) ] |
| 366 | // CHECK: Predecessors (1): B1 |
| 367 | // CHECK: Successors (0): |
| 368 | // CHECK: [ B14 (ENTRY) ] |
| 369 | // CHECK: Predecessors (0): |
| 370 | // CHECK: Successors (1): B13 |
| 371 | // CHECK: [ B1 ] |
| 372 | // CHECK: 1: ~B() (Temporary object destructor) |
| 373 | // CHECK: 2: int b; |
| 374 | // CHECK: 3: [B10.4].~A() (Implicit destructor) |
| 375 | // CHECK: Predecessors (2): B2 B3 |
| 376 | // CHECK: Successors (1): B0 |
| 377 | // CHECK: [ B2 ] |
| 378 | // CHECK: 1: ~A() (Temporary object destructor) |
| 379 | // CHECK: 2: ~A() (Temporary object destructor) |
| 380 | // CHECK: Predecessors (1): B4 |
| 381 | // CHECK: Successors (1): B1 |
| 382 | // CHECK: [ B3 ] |
| 383 | // CHECK: 1: ~A() (Temporary object destructor) |
| 384 | // CHECK: 2: ~A() (Temporary object destructor) |
| 385 | // CHECK: 3: ~A() (Temporary object destructor) |
| 386 | // CHECK: 4: ~B() (Temporary object destructor) |
| 387 | // CHECK: Predecessors (1): B4 |
| 388 | // CHECK: Successors (1): B1 |
| 389 | // CHECK: [ B4 ] |
| 390 | // CHECK: 1: [B7.5] ? [B5.5] : [B6.13] |
| 391 | // CHECK: 2: [B4.1] |
| 392 | // CHECK: 3: [B4.2] |
| 393 | // CHECK: 4: foo |
| 394 | // CHECK: 5: [B4.4] |
| 395 | // CHECK: 6: [B4.5]([B4.3]) |
| 396 | // CHECK: T: [B7.5] ? ... : ... |
| 397 | // CHECK: Predecessors (2): B5 B6 |
| 398 | // CHECK: Successors (2): B2 B3 |
| 399 | // CHECK: [ B5 ] |
| 400 | // CHECK: 1: A() |
| 401 | // CHECK: 2: [B5.1] (BindTemporary) |
| 402 | // CHECK: 3: [B5.2] |
| 403 | // CHECK: 4: [B5.3] |
| 404 | // CHECK: 5: [B5.4] (BindTemporary) |
| 405 | // CHECK: Predecessors (1): B7 |
| 406 | // CHECK: Successors (1): B4 |
| 407 | // CHECK: [ B6 ] |
| 408 | // CHECK: 1: B() |
| 409 | // CHECK: 2: [B6.1] (BindTemporary) |
| 410 | // CHECK: 3: [B6.2].operator A |
| 411 | // CHECK: 4: [B6.3]() |
| 412 | // CHECK: 5: [B6.4] (BindTemporary) |
| 413 | // CHECK: 6: [B6.5] |
| 414 | // CHECK: 7: [B6.6] |
| 415 | // CHECK: 8: [B6.7] |
| 416 | // CHECK: 9: [B6.8] (BindTemporary) |
| 417 | // CHECK: 10: A([B6.9]) |
| 418 | // CHECK: 11: [B6.10] |
| 419 | // CHECK: 12: [B6.11] |
| 420 | // CHECK: 13: [B6.12] (BindTemporary) |
| 421 | // CHECK: Predecessors (1): B7 |
| 422 | // CHECK: Successors (1): B4 |
| 423 | // CHECK: [ B7 ] |
| 424 | // CHECK: 1: ~B() (Temporary object destructor) |
| 425 | // CHECK: 2: B() |
| 426 | // CHECK: 3: [B7.2] (BindTemporary) |
| 427 | // CHECK: 4: [B7.3].operator _Bool |
| 428 | // CHECK: 5: [B7.4]() |
| 429 | // CHECK: T: [B7.5] ? ... : ... |
| 430 | // CHECK: Predecessors (2): B8 B9 |
| 431 | // CHECK: Successors (2): B5 B6 |
| 432 | // CHECK: [ B8 ] |
| 433 | // CHECK: 1: ~A() (Temporary object destructor) |
| 434 | // CHECK: Predecessors (1): B10 |
| 435 | // CHECK: Successors (1): B7 |
| 436 | // CHECK: [ B9 ] |
| 437 | // CHECK: 1: ~A() (Temporary object destructor) |
| 438 | // CHECK: 2: ~A() (Temporary object destructor) |
| 439 | // CHECK: 3: ~B() (Temporary object destructor) |
| 440 | // CHECK: Predecessors (1): B10 |
| 441 | // CHECK: Successors (1): B7 |
| 442 | // CHECK: [ B10 ] |
| 443 | // CHECK: 1: [B13.4] ? [B11.5] : [B12.13] |
| 444 | // CHECK: 2: [B10.1] |
| 445 | // CHECK: 3: [B10.2] |
| 446 | // CHECK: 4: const A &a = B().operator _Bool() ? A() : A(B().operator A()); |
| 447 | // CHECK: T: [B13.4] ? ... : ... |
| 448 | // CHECK: Predecessors (2): B11 B12 |
| 449 | // CHECK: Successors (2): B8 B9 |
| 450 | // CHECK: [ B11 ] |
| 451 | // CHECK: 1: A() |
| 452 | // CHECK: 2: [B11.1] (BindTemporary) |
| 453 | // CHECK: 3: [B11.2] |
| 454 | // CHECK: 4: [B11.3] |
| 455 | // CHECK: 5: [B11.4] (BindTemporary) |
| 456 | // CHECK: Predecessors (1): B13 |
| 457 | // CHECK: Successors (1): B10 |
| 458 | // CHECK: [ B12 ] |
| 459 | // CHECK: 1: B() |
| 460 | // CHECK: 2: [B12.1] (BindTemporary) |
| 461 | // CHECK: 3: [B12.2].operator A |
| 462 | // CHECK: 4: [B12.3]() |
| 463 | // CHECK: 5: [B12.4] (BindTemporary) |
| 464 | // CHECK: 6: [B12.5] |
| 465 | // CHECK: 7: [B12.6] |
| 466 | // CHECK: 8: [B12.7] |
| 467 | // CHECK: 9: [B12.8] (BindTemporary) |
| 468 | // CHECK: 10: A([B12.9]) |
| 469 | // CHECK: 11: [B12.10] |
| 470 | // CHECK: 12: [B12.11] |
| 471 | // CHECK: 13: [B12.12] (BindTemporary) |
| 472 | // CHECK: Predecessors (1): B13 |
| 473 | // CHECK: Successors (1): B10 |
| 474 | // CHECK: [ B13 ] |
| 475 | // CHECK: 1: B() |
| 476 | // CHECK: 2: [B13.1] (BindTemporary) |
| 477 | // CHECK: 3: [B13.2].operator _Bool |
| 478 | // CHECK: 4: [B13.3]() |
| 479 | // CHECK: T: [B13.4] ? ... : ... |
| 480 | // CHECK: Predecessors (1): B14 |
| 481 | // CHECK: Successors (2): B11 B12 |
| 482 | // CHECK: [ B0 (EXIT) ] |
| 483 | // CHECK: Predecessors (1): B1 |
| 484 | // CHECK: Successors (0): |
| 485 | // CHECK: [ B8 (ENTRY) ] |
| 486 | // CHECK: Predecessors (0): |
| 487 | // CHECK: Successors (1): B7 |
| 488 | // CHECK: [ B1 ] |
| 489 | // CHECK: 1: ~A() (Temporary object destructor) |
| 490 | // CHECK: 2: int b; |
| 491 | // CHECK: 3: [B4.4].~A() (Implicit destructor) |
| 492 | // CHECK: Predecessors (2): B2 B3 |
| 493 | // CHECK: Successors (1): B0 |
| 494 | // CHECK: [ B2 ] |
| 495 | // CHECK: 1: ~A() (Temporary object destructor) |
| 496 | // CHECK: Predecessors (1): B4 |
| 497 | // CHECK: Successors (1): B1 |
| 498 | // CHECK: [ B3 ] |
| 499 | // CHECK: 1: ~A() (Temporary object destructor) |
| 500 | // CHECK: 2: ~A() (Temporary object destructor) |
| 501 | // CHECK: Predecessors (1): B4 |
| 502 | // CHECK: Successors (1): B1 |
| 503 | // CHECK: [ B4 ] |
| 504 | // CHECK: 1: [B7.2] ?: [B6.5] |
| 505 | // CHECK: 2: [B4.1] |
| 506 | // CHECK: 3: [B4.2] |
| 507 | // CHECK: 4: A a = A() ?: A(); |
| 508 | // CHECK: T: [B7.5] ? ... : ... |
| 509 | // CHECK: Predecessors (2): B5 B6 |
| 510 | // CHECK: Successors (2): B2 B3 |
| 511 | // CHECK: [ B5 ] |
| 512 | // CHECK: 1: [B7.3] |
| 513 | // CHECK: 2: [B7.3] |
| 514 | // CHECK: 3: [B5.2] |
| 515 | // CHECK: 4: [B5.3] |
| 516 | // CHECK: 5: [B5.4] (BindTemporary) |
| 517 | // CHECK: Predecessors (1): B7 |
| 518 | // CHECK: Successors (1): B4 |
| 519 | // CHECK: [ B6 ] |
| 520 | // CHECK: 1: A() |
| 521 | // CHECK: 2: [B6.1] (BindTemporary) |
| 522 | // CHECK: 3: [B6.2] |
| 523 | // CHECK: 4: [B6.3] |
| 524 | // CHECK: 5: [B6.4] (BindTemporary) |
| 525 | // CHECK: Predecessors (1): B7 |
| 526 | // CHECK: Successors (1): B4 |
| 527 | // CHECK: [ B7 ] |
| 528 | // CHECK: 1: A() |
| 529 | // CHECK: 2: [B7.1] (BindTemporary) |
| 530 | // CHECK: 3: |
| 531 | // CHECK: 4: [B7.3].operator _Bool |
| 532 | // CHECK: 5: [B7.4]() |
| 533 | // CHECK: T: [B7.5] ? ... : ... |
| 534 | // CHECK: Predecessors (1): B8 |
| 535 | // CHECK: Successors (2): B5 B6 |
| 536 | // CHECK: [ B0 (EXIT) ] |
| 537 | // CHECK: Predecessors (1): B1 |
| 538 | // CHECK: Successors (0): |
| 539 | // CHECK: [ B13 (ENTRY) ] |
| 540 | // CHECK: Predecessors (0): |
| 541 | // CHECK: Successors (1): B12 |
| 542 | // CHECK: [ B1 ] |
| 543 | // CHECK: 1: ~A() (Temporary object destructor) |
| 544 | // CHECK: 2: int b; |
| 545 | // CHECK: 3: [B9.4].~A() (Implicit destructor) |
| 546 | // CHECK: Predecessors (2): B2 B3 |
| 547 | // CHECK: Successors (1): B0 |
| 548 | // CHECK: [ B2 ] |
| 549 | // CHECK: 1: ~A() (Temporary object destructor) |
| 550 | // CHECK: Predecessors (1): B4 |
| 551 | // CHECK: Successors (1): B1 |
| 552 | // CHECK: [ B3 ] |
| 553 | // CHECK: 1: ~A() (Temporary object destructor) |
| 554 | // CHECK: 2: ~A() (Temporary object destructor) |
| 555 | // CHECK: Predecessors (1): B4 |
| 556 | // CHECK: Successors (1): B1 |
| 557 | // CHECK: [ B4 ] |
| 558 | // CHECK: 1: [B7.3] ?: [B6.5] |
| 559 | // CHECK: 2: [B4.1] |
| 560 | // CHECK: 3: [B4.2] |
| 561 | // CHECK: 4: foo |
| 562 | // CHECK: 5: [B4.4] |
| 563 | // CHECK: 6: [B4.5]([B4.3]) |
| 564 | // CHECK: T: [B7.6] ? ... : ... |
| 565 | // CHECK: Predecessors (2): B5 B6 |
| 566 | // CHECK: Successors (2): B2 B3 |
| 567 | // CHECK: [ B5 ] |
| 568 | // CHECK: 1: [B7.4] |
| 569 | // CHECK: 2: [B7.4] |
| 570 | // CHECK: 3: [B5.2] |
| 571 | // CHECK: 4: [B5.3] |
| 572 | // CHECK: 5: [B5.4] (BindTemporary) |
| 573 | // CHECK: Predecessors (1): B7 |
| 574 | // CHECK: Successors (1): B4 |
| 575 | // CHECK: [ B6 ] |
| 576 | // CHECK: 1: A() |
| 577 | // CHECK: 2: [B6.1] (BindTemporary) |
| 578 | // CHECK: 3: [B6.2] |
| 579 | // CHECK: 4: [B6.3] |
| 580 | // CHECK: 5: [B6.4] (BindTemporary) |
| 581 | // CHECK: Predecessors (1): B7 |
| 582 | // CHECK: Successors (1): B4 |
| 583 | // CHECK: [ B7 ] |
| 584 | // CHECK: 1: ~A() (Temporary object destructor) |
| 585 | // CHECK: 2: A() |
| 586 | // CHECK: 3: [B7.2] (BindTemporary) |
| 587 | // CHECK: 4: |
| 588 | // CHECK: 5: [B7.4].operator _Bool |
| 589 | // CHECK: 6: [B7.5]() |
| 590 | // CHECK: T: [B7.6] ? ... : ... |
| 591 | // CHECK: Predecessors (2): B9 B8 |
| 592 | // CHECK: Successors (2): B5 B6 |
| 593 | // CHECK: [ B8 ] |
| 594 | // CHECK: 1: ~A() (Temporary object destructor) |
| 595 | // CHECK: Predecessors (1): B9 |
| 596 | // CHECK: Successors (1): B7 |
| 597 | // CHECK: [ B9 ] |
| 598 | // CHECK: 1: [B12.2] ?: [B11.5] |
| 599 | // CHECK: 2: [B9.1] |
| 600 | // CHECK: 3: [B9.2] |
| 601 | // CHECK: 4: const A &a = A() ?: A(); |
| 602 | // CHECK: T: [B12.5] ? ... : ... |
| 603 | // CHECK: Predecessors (2): B10 B11 |
| 604 | // CHECK: Successors (2): B7 B8 |
| 605 | // CHECK: [ B10 ] |
| 606 | // CHECK: 1: [B12.3] |
| 607 | // CHECK: 2: [B12.3] |
| 608 | // CHECK: 3: [B10.2] |
| 609 | // CHECK: 4: [B10.3] |
| 610 | // CHECK: 5: [B10.4] (BindTemporary) |
| 611 | // CHECK: Predecessors (1): B12 |
| 612 | // CHECK: Successors (1): B9 |
| 613 | // CHECK: [ B11 ] |
| 614 | // CHECK: 1: A() |
| 615 | // CHECK: 2: [B11.1] (BindTemporary) |
| 616 | // CHECK: 3: [B11.2] |
| 617 | // CHECK: 4: [B11.3] |
| 618 | // CHECK: 5: [B11.4] (BindTemporary) |
| 619 | // CHECK: Predecessors (1): B12 |
| 620 | // CHECK: Successors (1): B9 |
| 621 | // CHECK: [ B12 ] |
| 622 | // CHECK: 1: A() |
| 623 | // CHECK: 2: [B12.1] (BindTemporary) |
| 624 | // CHECK: 3: |
| 625 | // CHECK: 4: [B12.3].operator _Bool |
| 626 | // CHECK: 5: [B12.4]() |
| 627 | // CHECK: T: [B12.5] ? ... : ... |
| 628 | // CHECK: Predecessors (1): B13 |
| 629 | // CHECK: Successors (2): B10 B11 |
| 630 | // CHECK: [ B0 (EXIT) ] |
| 631 | // CHECK: Predecessors (1): B1 |
| 632 | // CHECK: Successors (0): |
| 633 | // CHECK: [ B2 (ENTRY) ] |
| 634 | // CHECK: Predecessors (0): |
| 635 | // CHECK: Successors (1): B1 |
| 636 | // CHECK: [ B1 ] |
| 637 | // CHECK: 1: A() |
| 638 | // CHECK: 2: [B1.1] (BindTemporary) |
| 639 | // CHECK: 3: [B1.2] |
| 640 | // CHECK: 4: [B1.3] |
| 641 | // CHECK: 5: A a = A(); |
| 642 | // CHECK: 6: ~A() (Temporary object destructor) |
| 643 | // CHECK: 7: int b; |
| 644 | // CHECK: 8: [B1.5].~A() (Implicit destructor) |
| 645 | // CHECK: Predecessors (1): B2 |
| 646 | // CHECK: Successors (1): B0 |
| 647 | // CHECK: [ B0 (EXIT) ] |
| 648 | // CHECK: Predecessors (1): B1 |
| 649 | // CHECK: Successors (0): |
| 650 | // CHECK: [ B2 (ENTRY) ] |
| 651 | // CHECK: Predecessors (0): |
| 652 | // CHECK: Successors (1): B1 |
| 653 | // CHECK: [ B1 ] |
| 654 | // CHECK: 1: A() |
| 655 | // CHECK: 2: [B1.1] (BindTemporary) |
| 656 | // CHECK: 3: [B1.2] |
| 657 | // CHECK: 4: [B1.3] |
| 658 | // CHECK: 5: const A &a = A(); |
| 659 | // CHECK: 6: A() |
| 660 | // CHECK: 7: [B1.6] (BindTemporary) |
| 661 | // CHECK: 8: [B1.7] |
| 662 | // CHECK: 9: [B1.8] |
| 663 | // CHECK: 10: foo |
| 664 | // CHECK: 11: [B1.10] |
| 665 | // CHECK: 12: [B1.11]([B1.9]) |
| 666 | // CHECK: 13: ~A() (Temporary object destructor) |
| 667 | // CHECK: 14: int b; |
| 668 | // CHECK: 15: [B1.5].~A() (Implicit destructor) |
| 669 | // CHECK: Predecessors (1): B2 |
| 670 | // CHECK: Successors (1): B0 |
| 671 | // CHECK: [ B0 (EXIT) ] |
| 672 | // CHECK: Predecessors (1): B1 |
| 673 | // CHECK: Successors (0): |
| 674 | // CHECK: [ B2 (ENTRY) ] |
| 675 | // CHECK: Predecessors (0): |
| 676 | // CHECK: Successors (1): B1 |
| 677 | // CHECK: [ B1 ] |
| 678 | // CHECK: 1: A::make |
| 679 | // CHECK: 2: [B1.1] |
| 680 | // CHECK: 3: [B1.2]() |
| 681 | // CHECK: 4: [B1.3] (BindTemporary) |
| 682 | // CHECK: 5: [B1.4] |
| 683 | // CHECK: 6: [B1.5] |
| 684 | // CHECK: 7: A a = A::make(); |
| 685 | // CHECK: 8: ~A() (Temporary object destructor) |
| 686 | // CHECK: 9: int b; |
| 687 | // CHECK: 10: [B1.7].~A() (Implicit destructor) |
| 688 | // CHECK: Predecessors (1): B2 |
| 689 | // CHECK: Successors (1): B0 |
| 690 | // CHECK: [ B0 (EXIT) ] |
| 691 | // CHECK: Predecessors (1): B1 |
| 692 | // CHECK: Successors (0): |
| 693 | // CHECK: [ B2 (ENTRY) ] |
| 694 | // CHECK: Predecessors (0): |
| 695 | // CHECK: Successors (1): B1 |
| 696 | // CHECK: [ B1 ] |
| 697 | // CHECK: 1: A::make |
| 698 | // CHECK: 2: [B1.1] |
| 699 | // CHECK: 3: [B1.2]() |
| 700 | // CHECK: 4: [B1.3] (BindTemporary) |
| 701 | // CHECK: 5: [B1.4] |
| 702 | // CHECK: 6: [B1.5] |
| 703 | // CHECK: 7: const A &a = A::make(); |
| 704 | // CHECK: 8: A::make |
| 705 | // CHECK: 9: [B1.8] |
| 706 | // CHECK: 10: [B1.9]() |
| 707 | // CHECK: 11: [B1.10] (BindTemporary) |
| 708 | // CHECK: 12: [B1.11] |
| 709 | // CHECK: 13: [B1.12] |
| 710 | // CHECK: 14: foo |
| 711 | // CHECK: 15: [B1.14] |
| 712 | // CHECK: 16: [B1.15]([B1.13]) |
| 713 | // CHECK: 17: ~A() (Temporary object destructor) |
| 714 | // CHECK: 18: int b; |
| 715 | // CHECK: 19: [B1.7].~A() (Implicit destructor) |
| 716 | // CHECK: Predecessors (1): B2 |
| 717 | // CHECK: Successors (1): B0 |
| 718 | // CHECK: [ B0 (EXIT) ] |
| 719 | // CHECK: Predecessors (1): B1 |
| 720 | // CHECK: Successors (0): |
| 721 | // CHECK: [ B2 (ENTRY) ] |
| 722 | // CHECK: Predecessors (0): |
| 723 | // CHECK: Successors (1): B1 |
| 724 | // CHECK: [ B1 ] |
| 725 | // CHECK: 1: int a; |
| 726 | // CHECK: 2: A() |
| 727 | // CHECK: 3: [B1.2] (BindTemporary) |
| 728 | // CHECK: 4: [B1.3].operator int |
| 729 | // CHECK: 5: [B1.4]() |
| 730 | // CHECK: 6: a |
| 731 | // CHECK: 7: [B1.6] = [B1.5] |
| 732 | // CHECK: 8: ~A() (Temporary object destructor) |
| 733 | // CHECK: 9: int b; |
| 734 | // CHECK: Predecessors (1): B2 |
| 735 | // CHECK: Successors (1): B0 |
| 736 | // CHECK: [ B0 (EXIT) ] |
| 737 | // CHECK: Predecessors (1): B1 |
| 738 | // CHECK: Successors (0): |
| 739 | // CHECK: [ B2 (ENTRY) ] |
| 740 | // CHECK: Predecessors (0): |
| 741 | // CHECK: Successors (1): B1 |
| 742 | // CHECK: [ B1 ] |
| 743 | // CHECK: 1: A() |
| 744 | // CHECK: 2: [B1.1] (BindTemporary) |
| 745 | // CHECK: 3: [B1.2].operator int |
| 746 | // CHECK: 4: [B1.3]() |
| 747 | // CHECK: 5: [B1.4] |
| 748 | // CHECK: 6: int([B1.5]) |
| 749 | // CHECK: 7: B() |
| 750 | // CHECK: 8: [B1.7] (BindTemporary) |
| 751 | // CHECK: 9: [B1.8].operator int |
| 752 | // CHECK: 10: [B1.9]() |
| 753 | // CHECK: 11: [B1.10] |
| 754 | // CHECK: 12: int([B1.11]) |
| 755 | // CHECK: 13: [B1.6] + [B1.12] |
| 756 | // CHECK: 14: a([B1.13]) (Member initializer) |
| 757 | // CHECK: 15: ~B() (Temporary object destructor) |
| 758 | // CHECK: 16: ~A() (Temporary object destructor) |
| 759 | // CHECK: 17: /*implicit*/int() |
| 760 | // CHECK: 18: b([B1.17]) (Member initializer) |
| 761 | // CHECK: Predecessors (1): B2 |
| 762 | // CHECK: Successors (1): B0 |
| 763 | // CHECK: [ B0 (EXIT) ] |
| 764 | // CHECK: Predecessors (1): B1 |
| 765 | // CHECK: Successors (0): |
| 766 | |