blob: c7008bbe4ff7335f982fbab4fb513c46cd4bbcd8 [file] [log] [blame]
Anders Carlssonbe71e3b2010-02-18 17:07:24 +00001// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm-only -fdump-vtable-layouts 2>&1 | FileCheck %s
2
3/// Examples from the Itanium C++ ABI specification.
4/// http://www.codesourcery.com/public/cxx-abi/
5
6namespace Test1 {
7
8// This is from http://www.codesourcery.com/public/cxx-abi/cxx-vtable-ex.html
9
10// CHECK: Vtable for 'Test1::A' (5 entries).
11// CHECK-NEXT: 0 | offset_to_top (0)
12// CHECK-NEXT: 1 | Test1::A RTTI
13// CHECK-NEXT: -- (Test1::A, 0) vtable address --
14// CHECK-NEXT: 2 | void Test1::A::f()
15// CHECK-NEXT: 3 | void Test1::A::g()
16// CHECK-NEXT: 4 | void Test1::A::h()
17struct A {
18 virtual void f ();
19 virtual void g ();
20 virtual void h ();
21 int ia;
22};
23void A::f() {}
24
25}