[cfe-commits] r96588 - /cfe/trunk/test/CodeGenCXX/vtable-layout-abi-examples.cpp

Anders Carlsson andersca at mac.com
Thu Feb 18 09:28:16 PST 2010


Author: andersca
Date: Thu Feb 18 11:28:16 2010
New Revision: 96588

URL: http://llvm.org/viewvc/llvm-project?rev=96588&view=rev
Log:
Add another class from cxx-vtable-ex.html

Modified:
    cfe/trunk/test/CodeGenCXX/vtable-layout-abi-examples.cpp

Modified: 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=96588&r1=96587&r2=96588&view=diff

==============================================================================
--- cfe/trunk/test/CodeGenCXX/vtable-layout-abi-examples.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/vtable-layout-abi-examples.cpp Thu Feb 18 11:28:16 2010
@@ -46,5 +46,29 @@
   int ib;
 };
 void B::f() {}
-  
+
+// CHECK:      Vtable for 'Test1::C' (13 entries).
+// CHECK-NEXT:    0 | vbase_offset (16)
+// CHECK-NEXT:    1 | offset_to_top (0)
+// CHECK-NEXT:    2 | Test1::C RTTI
+// CHECK-NEXT:        -- (Test1::C, 0) vtable address --
+// CHECK-NEXT:    3 | void Test1::C::g()
+// CHECK-NEXT:    4 | void Test1::C::h()
+// CHECK-NEXT:    5 | vcall_offset (-16)
+// CHECK-NEXT:    6 | vcall_offset (-16)
+// CHECK-NEXT:    7 | vcall_offset (0)
+// CHECK-NEXT:    8 | offset_to_top (-16)
+// CHECK-NEXT:    9 | Test1::C RTTI
+// CHECK-NEXT:        -- (Test1::A, 16) vtable address --
+// CHECK-NEXT:   10 | void Test1::A::f()
+// CHECK-NEXT:   11 | void Test1::C::g()
+// CHECK-NEXT:        [this adjustment: 0 non-virtual, -32 vcall offset offset]
+// CHECK-NEXT:   12 | void Test1::C::h()
+// CHECK-NEXT:        [this adjustment: 0 non-virtual, -40 vcall offset offset]
+struct C: public virtual A {
+  void g ();
+  void h ();
+  int ic;
+};
+void C::g() {}
 }





More information about the cfe-commits mailing list