r211505 - MS ABI: Add an additional test for typeid

David Majnemer david.majnemer at gmail.com
Mon Jun 23 10:30:28 PDT 2014


Author: majnemer
Date: Mon Jun 23 12:30:27 2014
New Revision: 211505

URL: http://llvm.org/viewvc/llvm-project?rev=211505&view=rev
Log:
MS ABI: Add an additional test for typeid

This tests typeid with polymorphic arguments which have an extendable
virtual function table.

Modified:
    cfe/trunk/test/CodeGenCXX/microsoft-abi-typeid.cpp

Modified: cfe/trunk/test/CodeGenCXX/microsoft-abi-typeid.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/microsoft-abi-typeid.cpp?rev=211505&r1=211504&r2=211505&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/microsoft-abi-typeid.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/microsoft-abi-typeid.cpp Mon Jun 23 12:30:27 2014
@@ -7,6 +7,7 @@ struct V { virtual void f(); };
 struct A : virtual V { A(); };
 
 extern A a;
+extern V v;
 extern int b;
 A* fn();
 
@@ -43,3 +44,9 @@ const std::type_info* test3_typeid() { r
 const std::type_info* test4_typeid() { return &typeid(b); }
 // CHECK: define %struct.type_info* @"\01?test4_typeid@@YAPBUtype_info@@XZ"()
 // CHECK:   ret %struct.type_info* bitcast (%"MSRTTITypeDescriptor\02"* @"\01??_R0H at 8" to %struct.type_info*)
+
+const std::type_info* test5_typeid() { return &typeid(v); }
+// CHECK: define %struct.type_info* @"\01?test5_typeid@@YAPBUtype_info@@XZ"()
+// CHECK:        [[RT:%.*]] = tail call i8* @__RTtypeid(i8* bitcast (%struct.V* @"\01?v@@3UV@@A" to i8*))
+// CHECK-NEXT:   [[RET:%.*]] = bitcast i8* [[RT]] to %struct.type_info*
+// CHECK-NEXT:   ret %struct.type_info* [[RET]]





More information about the cfe-commits mailing list