summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/thunks.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-09-14 01:45:09 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-09-14 01:45:09 +0000
commit00755e955469079e0a078bd5ce81e374ee419933 (patch)
tree93e29df0acfbba64a6c3fce06eafc04fee4e934e /clang/test/CodeGenCXX/thunks.cpp
parent48a32916758ac0250ad7dc325aaee7cbdce4c852 (diff)
downloadbcm5719-llvm-00755e955469079e0a078bd5ce81e374ee419933.tar.gz
bcm5719-llvm-00755e955469079e0a078bd5ce81e374ee419933.zip
Fix thunk emission for covariant virtual functions in cases which require
both a virtual and a non-virtual offset. PR13832. llvm-svn: 163866
Diffstat (limited to 'clang/test/CodeGenCXX/thunks.cpp')
-rw-r--r--clang/test/CodeGenCXX/thunks.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/thunks.cpp b/clang/test/CodeGenCXX/thunks.cpp
index 04d0820da7a..bf3b03e4e42 100644
--- a/clang/test/CodeGenCXX/thunks.cpp
+++ b/clang/test/CodeGenCXX/thunks.cpp
@@ -301,6 +301,32 @@ namespace Test12 {
// CHECK: getelementptr inbounds i8* {{.*}}, i64 8
}
+// PR13832
+namespace Test13 {
+ struct B1 {
+ virtual B1 &foo1();
+ };
+ struct Pad1 {
+ virtual ~Pad1();
+ };
+ struct Proxy1 : Pad1, B1 {
+ virtual ~Proxy1();
+ };
+ struct D : virtual Proxy1 {
+ virtual ~D();
+ virtual D &foo1();
+ };
+ D& D::foo1() {
+ return *this;
+ }
+ // CHECK: define {{.*}} @_ZTcvn8_n32_v8_n24_N6Test131D4foo1Ev
+ // CHECK: getelementptr inbounds i8* {{.*}}, i64 -8
+ // CHECK: getelementptr inbounds i8* {{.*}}, i64 -32
+ // CHECK: getelementptr inbounds i8* {{.*}}, i64 -24
+ // CHECK: getelementptr inbounds i8* {{.*}}, i64 8
+ // CHECK: ret %"struct.Test13::D"*
+}
+
/**** The following has to go at the end of the file ****/
// This is from Test5:
OpenPOWER on IntegriCloud