2010-02-11 16:02:13 +08:00
|
|
|
// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm-only -fdump-vtable-layouts 2>&1 | FileCheck %s
|
|
|
|
namespace Test1 {
|
|
|
|
|
|
|
|
// CHECK: Vtable for 'Test1::A' (3 entries).
|
|
|
|
// CHECK-NEXT: 0 | offset_to_top (0)
|
|
|
|
// CHECK-NEXT: 1 | Test1::A RTTI
|
2010-02-12 01:18:51 +08:00
|
|
|
// CHECK-NEXT: -- (Test1::A, 0) vtable address --
|
2010-02-12 02:20:28 +08:00
|
|
|
// CHECK-NEXT: 2 | void Test1::A::f()
|
2010-02-11 16:02:13 +08:00
|
|
|
struct A {
|
|
|
|
virtual void f();
|
|
|
|
};
|
|
|
|
|
|
|
|
void A::f() { }
|
|
|
|
}
|
|
|
|
|
2010-02-12 02:20:28 +08:00
|
|
|
namespace Test2 {
|
|
|
|
|
|
|
|
// This is a smoke test of the vtable dumper.
|
|
|
|
// CHECK: Vtable for 'Test2::A' (8 entries).
|
|
|
|
// CHECK-NEXT: 0 | offset_to_top (0)
|
|
|
|
// CHECK-NEXT: 1 | Test2::A RTTI
|
|
|
|
// CHECK-NEXT: -- (Test2::A, 0) vtable address --
|
|
|
|
// CHECK-NEXT: 2 | void Test2::A::f()
|
|
|
|
// CHECK-NEXT: 3 | void Test2::A::f() const
|
|
|
|
// CHECK-NEXT: 4 | Test2::A *Test2::A::g(int)
|
|
|
|
// CHECK-NEXT: 5 | Test2::A::~A() [complete]
|
|
|
|
// CHECK-NEXT: 6 | Test2::A::~A() [deleting]
|
|
|
|
// CHECK-NEXT: 7 | void Test2::A::h()
|
|
|
|
struct A {
|
|
|
|
virtual void f();
|
|
|
|
virtual void f() const;
|
|
|
|
|
|
|
|
virtual A* g(int a);
|
|
|
|
virtual ~A();
|
|
|
|
virtual void h();
|
|
|
|
};
|
|
|
|
|
|
|
|
void A::f() { }
|
|
|
|
|
|
|
|
}
|