diff options
author | Anders Carlsson <andersca@mac.com> | 2010-03-27 20:50:27 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-03-27 20:50:27 +0000 |
commit | ada087c4518a18f844ecc051b07039064016a4ba (patch) | |
tree | 582ddc7c746f2582f32f4303e2d75160b210b08e /test/CodeGenCXX/thunks.cpp | |
parent | 8822f7cda557ffa755c16b5c978dada23c37d6be (diff) |
Give thunks the same linkage as their original methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99729 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/thunks.cpp')
-rw-r--r-- | test/CodeGenCXX/thunks.cpp | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/test/CodeGenCXX/thunks.cpp b/test/CodeGenCXX/thunks.cpp index 2389839921..b91ba3239b 100644 --- a/test/CodeGenCXX/thunks.cpp +++ b/test/CodeGenCXX/thunks.cpp @@ -18,7 +18,7 @@ struct C : A, B { virtual void f(); }; -// CHECK: define weak void @_ZThn8_N5Test11C1fEv( +// CHECK: define void @_ZThn8_N5Test11C1fEv( void C::f() { } } @@ -36,7 +36,7 @@ struct B : virtual A { virtual void f(); }; -// CHECK: define weak void @_ZTv0_n24_N5Test21B1fEv( +// CHECK: define void @_ZTv0_n24_N5Test21B1fEv( void B::f() { } } @@ -58,7 +58,7 @@ struct B : A { virtual V2 *f(); }; -// CHECK: define weak %{{.*}}* @_ZTch0_v0_n24_N5Test31B1fEv( +// CHECK: define %{{.*}}* @_ZTch0_v0_n24_N5Test31B1fEv( V2 *B::f() { return 0; } } @@ -81,11 +81,14 @@ struct __attribute__((visibility("protected"))) C : A, B { virtual void f(); }; -// CHECK: define weak protected void @_ZThn8_N5Test41C1fEv( +// CHECK: define protected void @_ZThn8_N5Test41C1fEv( void C::f() { } } +// This is from Test5: +// CHECK: define linkonce_odr void @_ZTv0_n24_N5Test51B1fEv + // Check that the thunk gets internal linkage. namespace { @@ -114,3 +117,21 @@ void f() { c.f(); } + +namespace Test5 { + +// Check that the thunk for 'B::f' gets the same linkage as the function itself. +struct A { + virtual void f(); +}; + +struct B : virtual A { + virtual void f() { } +}; + +void f(B b) { + b.f(); +} +} + + |