54 lines · plain
1// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s2 3// PR7864. This all follows GCC's lead.4 5namespace std { class type_info; }6 7@interface A8@end9 10@interface B : A11@end12 13// CHECK: @_ZTIP1B = linkonce_odr constant {{.*}}@_ZTVN10__cxxabiv119__pointer_type_infoE{{.*}}@_ZTSP1B{{.*}}, i32 0, {{.*}}@_ZTI1B14// CHECK: @_ZTI1B = linkonce_odr constant {{.*}}@_ZTVN10__cxxabiv120__si_class_type_infoE{{.*}}@_ZTS1B{{.*}}@_ZTI1A15// CHECK: @_ZTI1A = linkonce_odr constant {{.*}}@_ZTVN10__cxxabiv117__class_type_infoE{{.*}}@_ZTS1A16 17// CHECK: @_ZTIP11objc_object = linkonce_odr constant {{.*}}@_ZTVN10__cxxabiv119__pointer_type_infoE{{.*}}@_ZTSP11objc_object{{.*}}@_ZTI11objc_object18// CHECK: @_ZTI11objc_object = linkonce_odr constant {{.*}}@_ZTVN10__cxxabiv117__class_type_infoE{{.*}}@_ZTS11objc_object19// CHECK: @_ZTIP10objc_class = linkonce_odr constant {{.*}}@_ZTVN10__cxxabiv119__pointer_type_infoE{{.*}}@_ZTSP10objc_class{{.*}}@_ZTI10objc_class20// CHECK: @_ZTI10objc_class = linkonce_odr constant {{.*}}@_ZTVN10__cxxabiv117__class_type_infoE{{.*}}@_ZTS10objc_class21 22@protocol P;23 24int main() {25 // CHECK: store {{.*}} @_ZTIP1B26 // CHECK: store {{.*}} @_ZTI1B27 const std::type_info &t1 = typeid(B*);28 const std::type_info &t2 = typeid(B);29 30 // CHECK: store {{.*}} @_ZTIP11objc_object31 // CHECK: store {{.*}} @_ZTI11objc_object32 id i = 0;33 const std::type_info &t3 = typeid(i);34 const std::type_info &t4 = typeid(*i);35 36 // CHECK: store {{.*}} @_ZTIP10objc_class37 // CHECK: store {{.*}} @_ZTI10objc_class38 Class c = 0;39 const std::type_info &t5 = typeid(c);40 const std::type_info &t6 = typeid(*c);41 42 // CHECK: store {{.*}} @_ZTIPU11objcproto1P11objc_object43 // CHECK: store {{.*}} @_ZTIU11objcproto1P11objc_object44 id<P> i2 = 0;45 const std::type_info &t7 = typeid(i2);46 const std::type_info &t8 = typeid(*i2);47 48 // CHECK: store {{.*}} @_ZTIPU11objcproto1P10objc_class49 // CHECK: store {{.*}} @_ZTIU11objcproto1P10objc_class50 Class<P> c2 = 0;51 const std::type_info &t9 = typeid(c2);52 const std::type_info &t10 = typeid(*c2);53}54