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 | 174376629a6b2a593137a13dc76b9867ff2575a6 (patch) | |
tree | 791aa6a1a97d4cf66155ad1e31c81d75984a184f /clang/test/CodeGenCXX | |
parent | 725d3f62193b943aad1db5c5eb96f3ceedd61341 (diff) | |
download | bcm5719-llvm-174376629a6b2a593137a13dc76b9867ff2575a6.tar.gz bcm5719-llvm-174376629a6b2a593137a13dc76b9867ff2575a6.zip |
Give thunks the same linkage as their original methods.
llvm-svn: 99729
Diffstat (limited to 'clang/test/CodeGenCXX')
-rw-r--r-- | clang/test/CodeGenCXX/thunks.cpp | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/clang/test/CodeGenCXX/thunks.cpp b/clang/test/CodeGenCXX/thunks.cpp index 2389839921b..b91ba3239b1 100644 --- a/clang/test/CodeGenCXX/thunks.cpp +++ b/clang/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(); +} +} + + |