Home | History | Annotate | Download | only in Analysis
      1 // RUN: %clang_cc1 -analyze -analyzer-checker=debug.DumpCFG %s 2>&1 | FileCheck %s
      2 
      3 class A {
      4 public:
      5   ~A() {}
      6 };
      7 
      8 class B : public virtual A {
      9 public:
     10   ~B() {}
     11 };
     12 
     13 class C : public virtual A {
     14 public:
     15   ~C() {}
     16 };
     17 
     18 class TestOrder : public C, public B, public virtual A {
     19   A a;
     20   int i;
     21   A *p;
     22 public:
     23   ~TestOrder();
     24 };
     25 
     26 TestOrder::~TestOrder() {}
     27 
     28 class TestArray {
     29   A a[2];
     30   A b[0];
     31 public:
     32   ~TestArray();
     33 };
     34 
     35 TestArray::~TestArray() {}
     36 
     37 // CHECK:  [B2 (ENTRY)]
     38 // CHECK:    Succs (1): B1
     39 // CHECK:  [B1]
     40 // CHECK:    1: this->a.~A() (Member object destructor)
     41 // CHECK:    2: ~B() (Base object destructor)
     42 // CHECK:    3: ~C() (Base object destructor)
     43 // CHECK:    4: ~A() (Base object destructor)
     44 // CHECK:    Preds (1): B2
     45 // CHECK:    Succs (1): B0
     46 // CHECK:  [B0 (EXIT)]
     47 // CHECK:    Preds (1): B1
     48 // CHECK:  [B2 (ENTRY)]
     49 // CHECK:    Succs (1): B1
     50 // CHECK:  [B1]
     51 // CHECK:    1: this->a.~A() (Member object destructor)
     52 // CHECK:    Preds (1): B2
     53 // CHECK:    Succs (1): B0
     54 // CHECK:  [B0 (EXIT)]
     55 // CHECK:    Preds (1): B1
     56