diff options
author | Anders Carlsson <andersca@mac.com> | 2009-12-20 22:30:54 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-12-20 22:30:54 +0000 |
commit | d008129f3494323dba0f16e0886624cfd358ec60 (patch) | |
tree | bb40a5f9e5acf8fad7ad78b0dbbf097c3f8e2d7c /clang/test/CodeGenCXX/rtti-linkage.cpp | |
parent | 7dac3712a2dd59d8a892f7c042521fb346616d9f (diff) | |
download | bcm5719-llvm-d008129f3494323dba0f16e0886624cfd358ec60.tar.gz bcm5719-llvm-d008129f3494323dba0f16e0886624cfd358ec60.zip |
Rework the way pointer types are handled by the RTTI builder. We now get the right linkage for indirect pointers to incomplete structs.
llvm-svn: 91799
Diffstat (limited to 'clang/test/CodeGenCXX/rtti-linkage.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/rtti-linkage.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/clang/test/CodeGenCXX/rtti-linkage.cpp b/clang/test/CodeGenCXX/rtti-linkage.cpp index 451d3fb2704..22e859d69c9 100644 --- a/clang/test/CodeGenCXX/rtti-linkage.cpp +++ b/clang/test/CodeGenCXX/rtti-linkage.cpp @@ -1,10 +1,14 @@ -// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 %s -I%S -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s +#include <typeinfo> // CHECK: _ZTS1B = constant // CHECK: _ZTS1A = weak_odr constant // CHECK: _ZTI1A = weak_odr constant // CHECK: _ZTI1B = constant - +// CHECK: _ZTSP1C = internal constant +// CHECK: _ZTIP1C = internal constant +// CHECK: _ZTSPP1C = internal constant +// CHECK: _ZTIPP1C = internal constant // A has no key function, so its RTTI data should be weak_odr. struct A { }; @@ -14,3 +18,14 @@ struct B : A { virtual void f(); }; void B::f() { } + +// C is an incomplete class type, so any direct or indirect pointer types should have +// internal linkage, as should the type info for C itself (FIXME). +struct C; + +void f() { + (void)typeid(C*); + (void)typeid(C**); + +} + |