diff options
author | Mike Stump <mrs@apple.com> | 2009-11-17 21:44:24 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-11-17 21:44:24 +0000 |
commit | 61c38012571dbabf1bf8f12c31bb64af1fc8d1d5 (patch) | |
tree | 3a71f07cdcd888f22bdc16c94789ed58410cd598 /test | |
parent | a03d0dd528573d0fc340370dc30ee7767c9cae9c (diff) |
Add rtti support for non-member pointers. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89148 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGenCXX/rtti.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/test/CodeGenCXX/rtti.cpp b/test/CodeGenCXX/rtti.cpp index 8af77de1c2..c761bdf46f 100644 --- a/test/CodeGenCXX/rtti.cpp +++ b/test/CodeGenCXX/rtti.cpp @@ -31,6 +31,16 @@ class test1_D : public test1_B7 { virtual void foo() { } } d1; +// CHECK: __ZTSPVi: +// CHECK-NEXT: .asciz "PVi" + +// CHECK: __ZTIPVi: +// CHECK-NEXT: .quad (__ZTVN10__cxxabiv119__pointer_type_infoE) + 16 +// CHECK-NEXT: .quad __ZTSPVi +// CHECK-NEXT: .long 2 +// CHECK-NEXT: .space 4 +// CHECK-NEXT: .quad __ZTIi + // CHECK:__ZTI7test1_D: // CHECK-NEXT: .quad (__ZTVN10__cxxabiv120__si_class_type_infoE) + 16 // CHECK-NEXT: .quad __ZTS7test1_D @@ -116,9 +126,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 (%1* @_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 (%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 (%1* @_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: %3 = bitcast %class.test1_B7* %tmp5 to %"class.std::type_info"*** // CHECK-LL-NEXT: %4 = icmp ne %"class.std::type_info"*** %3, null @@ -130,8 +140,14 @@ 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 (%1* @_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 (%2* @_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"*)) + +int test3() { + if (typeid(volatile int *) == typeid(int *)) + return 1; + return 0; +} |