summaryrefslogtreecommitdiff
path: root/clang/test/Analysis/dtors-in-dtor-cfg-output.cpp
blob: 68ba37ebf3990ef7a0a4572e4192bb9124a85459 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCFG -cfg-add-implicit-dtors %s 2>&1 | FileCheck %s
// XPASS: *

class A {
public:
  ~A() {}
};

class B : public virtual A {
public:
  ~B() {}
};

class C : public virtual A {
public:
  ~C() {}
};

class TestOrder : public C, public B, public virtual A {
  A a;
  int i;
  A *p;
public:
  ~TestOrder();
};

TestOrder::~TestOrder() {}

class TestArray {
  A a[2];
  A b[0];
public:
  ~TestArray();
};

TestArray::~TestArray() {}

// CHECK:  [B2 (ENTRY)]
// CHECK:    Succs (1): B1
// CHECK:  [B1]
// CHECK:    1: this->a.~A() (Member object destructor)
// CHECK:    2: ~B() (Base object destructor)
// CHECK:    3: ~C() (Base object destructor)
// CHECK:    4: ~A() (Base object destructor)
// CHECK:    Preds (1): B2
// CHECK:    Succs (1): B0
// CHECK:  [B0 (EXIT)]
// CHECK:    Preds (1): B1
// CHECK:  [B2 (ENTRY)]
// CHECK:    Succs (1): B1
// CHECK:  [B1]
// CHECK:    1: this->a.~A() (Member object destructor)
// CHECK:    Preds (1): B2
// CHECK:    Succs (1): B0
// CHECK:  [B0 (EXIT)]
// CHECK:    Preds (1): B1