diff options
author | Anders Carlsson <andersca@mac.com> | 2010-02-18 17:07:24 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-02-18 17:07:24 +0000 |
commit | be71e3b28a1440fe08c45ecbe25899d99235c309 (patch) | |
tree | 3ce67eca66df1e6f381285259899c7bd2326a76b | |
parent | 60cc72af073f10050f20aaf11dd1487a310e6c0f (diff) |
Add tests from the Itanium C++ ABI spec.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96586 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/CodeGenCXX/vtable-layout-abi-examples.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/CodeGenCXX/vtable-layout-abi-examples.cpp b/test/CodeGenCXX/vtable-layout-abi-examples.cpp new file mode 100644 index 0000000000..c7008bbe4f --- /dev/null +++ b/test/CodeGenCXX/vtable-layout-abi-examples.cpp @@ -0,0 +1,25 @@ +// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm-only -fdump-vtable-layouts 2>&1 | FileCheck %s + +/// Examples from the Itanium C++ ABI specification. +/// http://www.codesourcery.com/public/cxx-abi/ + +namespace Test1 { + +// This is from http://www.codesourcery.com/public/cxx-abi/cxx-vtable-ex.html + +// CHECK: Vtable for 'Test1::A' (5 entries). +// CHECK-NEXT: 0 | offset_to_top (0) +// CHECK-NEXT: 1 | Test1::A RTTI +// CHECK-NEXT: -- (Test1::A, 0) vtable address -- +// CHECK-NEXT: 2 | void Test1::A::f() +// CHECK-NEXT: 3 | void Test1::A::g() +// CHECK-NEXT: 4 | void Test1::A::h() +struct A { + virtual void f (); + virtual void g (); + virtual void h (); + int ia; +}; +void A::f() {} + +} |