diff options
author | John McCall <rjmccall@apple.com> | 2014-03-10 22:27:33 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2014-03-10 22:27:33 +0000 |
commit | 82ff42d42a852633ccad86b23c01c573358699ff (patch) | |
tree | c2758006f0f4d34158d286c4ac025e2cec02ae20 /test/CodeGenCXX/rtti-linkage.cpp | |
parent | 815fcf90db0cd6c45710bad63b8ef554b4f9ab45 (diff) |
RTTI symbols for visible local types may need weak linkage.
Previously, we would always emit them with internal linkage,
but with hidden visibility when the function was hidden, which
is an illegal combination, which could lead LLVM to actually
emit them as strong hidden symbols with hilarious results.
rdar://16265084
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203503 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/rtti-linkage.cpp')
-rw-r--r-- | test/CodeGenCXX/rtti-linkage.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/CodeGenCXX/rtti-linkage.cpp b/test/CodeGenCXX/rtti-linkage.cpp index 3eaf133bd6..1484b99b19 100644 --- a/test/CodeGenCXX/rtti-linkage.cpp +++ b/test/CodeGenCXX/rtti-linkage.cpp @@ -8,6 +8,14 @@ // CHECK-WITH-HIDDEN: @_ZTS2T4 = linkonce_odr hidden constant // CHECK-WITH-HIDDEN: @_ZTI2T4 = linkonce_odr hidden constant // CHECK-WITH-HIDDEN: @_ZTIPK2T4 = linkonce_odr hidden constant +// CHECK-WITH-HIDDEN: @_ZTSZ2t5vE1A = internal constant +// CHECK-WITH-HIDDEN: @_ZTIZ2t5vE1A = internal constant +// CHECK-WITH-HIDDEN: @_ZTSPZ2t7vE1A = linkonce_odr hidden constant +// CHECK-WITH-HIDDEN: @_ZTSZ2t7vE1A = linkonce_odr hidden constant +// CHECK-WITH-HIDDEN: @_ZTIZ2t7vE1A = linkonce_odr hidden constant +// CHECK-WITH-HIDDEN: @_ZTIPZ2t7vE1A = linkonce_odr hidden constant +// CHECK-WITH-HIDDEN: @_ZTSZ2t6vE1A = linkonce_odr hidden constant +// CHECK-WITH-HIDDEN: @_ZTIZ2t6vE1A = linkonce_odr hidden constant // CHECK: _ZTSP1C = internal constant // CHECK: _ZTS1C = internal constant @@ -48,9 +56,17 @@ // CHECK: _ZTI1TILj0EE = linkonce_odr constant // CHECK: _ZTI1TILj1EE = weak_odr constant // CHECK: _ZTI1TILj2EE = external constant +// CHECK: _ZTSZ2t5vE1A = internal constant +// CHECK: _ZTIZ2t5vE1A = internal constant // CHECK: _ZTS1B = constant // CHECK: _ZTI1B = constant // CHECK: _ZTS1F = linkonce_odr constant +// CHECK: _ZTSPZ2t7vE1A = linkonce_odr constant +// CHECK: _ZTSZ2t7vE1A = linkonce_odr constant +// CHECK: _ZTIZ2t7vE1A = linkonce_odr constant +// CHECK: _ZTIPZ2t7vE1A = linkonce_odr constant +// CHECK: _ZTSZ2t6vE1A = linkonce_odr constant +// CHECK: _ZTIZ2t6vE1A = linkonce_odr constant // CHECK: _ZTIN12_GLOBAL__N_11DE to @@ -138,3 +154,25 @@ struct T4 {}; void t4(const T4 *ptr) { const void *value = &typeid(ptr); } + +// rdar://16265084 +void t5() { + struct A {}; + const void *value = &typeid(A); +} + +inline void t6() { + struct A {}; + const void *value = &typeid(A); +} +void t6_helper() { + t6(); +} + +inline void t7() { + struct A {}; + const void *value = &typeid(A*); +} +void t7_helper() { + t7(); +} |