[cfe-commits] r96586 - /cfe/trunk/test/CodeGenCXX/vtable-layout-abi-examples.cpp
Anders Carlsson
andersca at mac.com
Thu Feb 18 09:07:25 PST 2010
Author: andersca
Date: Thu Feb 18 11:07:24 2010
New Revision: 96586
URL: http://llvm.org/viewvc/llvm-project?rev=96586&view=rev
Log:
Add tests from the Itanium C++ ABI spec.
Added:
cfe/trunk/test/CodeGenCXX/vtable-layout-abi-examples.cpp
Added: cfe/trunk/test/CodeGenCXX/vtable-layout-abi-examples.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/vtable-layout-abi-examples.cpp?rev=96586&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/vtable-layout-abi-examples.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/vtable-layout-abi-examples.cpp Thu Feb 18 11:07:24 2010
@@ -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() {}
+
+}
More information about the cfe-commits
mailing list