summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/thunks.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-20 05:54:35 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-20 05:54:35 +0000
commitaa2ac80eaaaea7d99e1efecf52abb4b167dc11c8 (patch)
tree5a0dd6fcd0575d8af615c491b9d8b5643e7a7734 /clang/test/CodeGenCXX/thunks.cpp
parentc53cc4f8bff66f88b4c612135ea878eb070aa08e (diff)
downloadbcm5719-llvm-aa2ac80eaaaea7d99e1efecf52abb4b167dc11c8.tar.gz
bcm5719-llvm-aa2ac80eaaaea7d99e1efecf52abb4b167dc11c8.zip
When creating a this-adjustment thunk where the return value is of C++
class type (that uses a return slot), pass the return slot to the callee directly rather than allocating new storage and trying to copy the object. This appears to have been the cause of the remaining two Boost.Interprocess failures. llvm-svn: 104215
Diffstat (limited to 'clang/test/CodeGenCXX/thunks.cpp')
-rw-r--r--clang/test/CodeGenCXX/thunks.cpp49
1 files changed, 45 insertions, 4 deletions
diff --git a/clang/test/CodeGenCXX/thunks.cpp b/clang/test/CodeGenCXX/thunks.cpp
index 7d2edaa7457..8144770763d 100644
--- a/clang/test/CodeGenCXX/thunks.cpp
+++ b/clang/test/CodeGenCXX/thunks.cpp
@@ -86,10 +86,6 @@ void C::f() { }
}
-// This is from Test5:
-// CHECK: define linkonce_odr void @_ZTv0_n24_N5Test51B1fEv
-// CHECK: define internal void @_ZThn8_N12_GLOBAL__N_11C1fEv(
-
// Check that the thunk gets internal linkage.
namespace {
@@ -134,4 +130,49 @@ void f(B b) {
}
}
+namespace Test6 {
+ struct X {
+ X();
+ X(const X&);
+ X &operator=(const X&);
+ ~X();
+ };
+
+ struct P {
+ P();
+ P(const P&);
+ ~P();
+ X first;
+ X second;
+ };
+
+ P getP();
+
+ struct Base1 {
+ int i;
+
+ virtual X f() { return X(); }
+ };
+
+ struct Base2 {
+ float real;
+ virtual X f() { return X(); }
+ };
+
+ struct Thunks : Base1, Base2 {
+ long l;
+
+ virtual X f();
+ };
+
+ // CHECK: define void @_ZThn16_N5Test66Thunks1fEv
+ // CHECK-NOT: memcpy
+ // CHECK: {{call void @_ZN5Test66Thunks1fEv.*sret}}
+ // CHECK: ret void
+ X Thunks::f() { return X(); }
+}
+
+// This is from Test5:
+// CHECK: define linkonce_odr void @_ZTv0_n24_N5Test51B1fEv
+// CHECK: define internal void @_ZThn8_N12_GLOBAL__N_11C1fEv(
OpenPOWER on IntegriCloud