aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/rtti.cpp
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-11-17 22:33:00 +0000
committerMike Stump <mrs@apple.com>2009-11-17 22:33:00 +0000
commit5fae856de2520b63fd371c281a9d36c1547e17f3 (patch)
tree1bd7ed41ecb07d8384537e54f3a76d9eca3ee733 /test/CodeGenCXX/rtti.cpp
parentd8aefab741a788ba308468df0c66c9dafb4c8530 (diff)
Add rtti support for pointer to data members.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89155 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/rtti.cpp')
-rw-r--r--test/CodeGenCXX/rtti.cpp29
1 files changed, 26 insertions, 3 deletions
diff --git a/test/CodeGenCXX/rtti.cpp b/test/CodeGenCXX/rtti.cpp
index c761bdf46f..3d8f116fc1 100644
--- a/test/CodeGenCXX/rtti.cpp
+++ b/test/CodeGenCXX/rtti.cpp
@@ -41,6 +41,23 @@ class test1_D : public test1_B7 {
// CHECK-NEXT: .space 4
// CHECK-NEXT: .quad __ZTIi
+// CHECK: __ZTIM7test3_Ai:
+// CHECK-NEXT: .quad (__ZTVN10__cxxabiv129__pointer_to_member_type_infoE) + 16
+// CHECK-NEXT: .quad __ZTSM7test3_Ai
+// CHECK-NEXT: .space 4
+// CHECK-NEXT: .space 4
+// CHECK-NEXT: .quad __ZTIi
+// CHECK-NEXT: .quad __ZTI7test3_A
+
+// CHECK:__ZTIM7test3_Ii:
+// CHECK-NEXT: .quad (__ZTVN10__cxxabiv129__pointer_to_member_type_infoE) + 16
+// CHECK-NEXT: .quad __ZTSM7test3_Ii
+// CHECK-NEXT: .long 16
+// CHECK-NEXT: .space 4
+// CHECK-NEXT: .quad __ZTIi
+// CHECK-NEXT: .quad __ZTI7test3_I
+
+
// CHECK:__ZTI7test1_D:
// CHECK-NEXT: .quad (__ZTVN10__cxxabiv120__si_class_type_infoE) + 16
// CHECK-NEXT: .quad __ZTS7test1_D
@@ -126,9 +143,9 @@ void test2_2(test1_D *dp) {
// CHECK-LL-NEXT: %vtable = load %"class.std::type_info"*** %0
// CHECK-LL-NEXT: %1 = getelementptr inbounds %"class.std::type_info"** %vtable, i64 -1
// CHECK-LL-NEXT: %2 = load %"class.std::type_info"** %1
-// CHECK-LL-NEXT: %call = call zeroext i1 @_ZNKSt9type_infoeqERKS_(%"class.std::type_info"* %2, %"class.std::type_info"* bitcast (%2* @_ZTI7test1_D to %"class.std::type_info"*))
+// CHECK-LL-NEXT: %call = call zeroext i1 @_ZNKSt9type_infoeqERKS_(%"class.std::type_info"* %2, %"class.std::type_info"* bitcast (%{{[0-9]*}}* @_ZTI7test1_D to %"class.std::type_info"*))
-// CHECK-LL: %call2 = call zeroext i1 @_ZNKSt9type_infoeqERKS_(%"class.std::type_info"* bitcast (%0* @_ZTI2NP to %"class.std::type_info"*), %"class.std::type_info"* bitcast (%2* @_ZTI7test1_D to %"class.std::type_info"*))
+// CHECK-LL: %call2 = call zeroext i1 @_ZNKSt9type_infoeqERKS_(%"class.std::type_info"* bitcast (%0* @_ZTI2NP to %"class.std::type_info"*), %"class.std::type_info"* bitcast (%{{[0-9]*}}* @_ZTI7test1_D to %"class.std::type_info"*))
// CHECK-LL: %3 = bitcast %class.test1_B7* %tmp5 to %"class.std::type_info"***
// CHECK-LL-NEXT: %4 = icmp ne %"class.std::type_info"*** %3, null
@@ -140,14 +157,20 @@ void test2_2(test1_D *dp) {
// CHECK-LL-NEXT: %vtable6 = load %"class.std::type_info"*** %3
// CHECK-LL-NEXT: %7 = getelementptr inbounds %"class.std::type_info"** %vtable6, i64 -1
// CHECK-LL-NEXT: %8 = load %"class.std::type_info"** %7
-// CHECK-LL-NEXT: %call7 = call zeroext i1 @_ZNKSt9type_infoeqERKS_(%"class.std::type_info"* %8, %"class.std::type_info"* bitcast (%2* @_ZTI7test1_D to %"class.std::type_info"*))
+// CHECK-LL-NEXT: %call7 = call zeroext i1 @_ZNKSt9type_infoeqERKS_(%"class.std::type_info"* %8, %"class.std::type_info"* bitcast (%{{[0-9]*}}* @_ZTI7test1_D to %"class.std::type_info"*))
// CHECK-LL: %call10 = call zeroext i1 @_ZNKSt9type_infoeqERKS_(%"class.std::type_info"* bitcast (i8** @_ZTIi to %"class.std::type_info"*), %"class.std::type_info"* bitcast (i8** @_ZTIf to %"class.std::type_info"*))
// CHECK-LL: %call13 = call zeroext i1 @_ZNKSt9type_infoeqERKS_(%"class.std::type_info"* bitcast (i8** @_ZTIPi to %"class.std::type_info"*), %"class.std::type_info"* bitcast (i8** @_ZTIPKi to %"class.std::type_info"*))
+class test3_A { };
+class test3_I;
+int (test3_A::*pmd);
+int (test3_I::*i_pmd);
int test3() {
if (typeid(volatile int *) == typeid(int *))
return 1;
+ if (typeid(pmd) == typeid(i_pmd))
+ return 1;
return 0;
}