diff options
author | Anders Carlsson <andersca@mac.com> | 2011-01-29 03:18:56 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2011-01-29 03:18:56 +0000 |
commit | a376b536951f892bcc31928a7a9cc205d5d9bc1b (patch) | |
tree | 5a5ce89c1d591f7fe3759ba249269c8de17b7851 /clang/test/CodeGenCXX/derived-to-virtual-base-class-calls-final.cpp | |
parent | 65b8ccf6ac2c9c639ff91a31c7962c7f92deb266 (diff) | |
download | bcm5719-llvm-a376b536951f892bcc31928a7a9cc205d5d9bc1b.tar.gz bcm5719-llvm-a376b536951f892bcc31928a7a9cc205d5d9bc1b.zip |
When doing a derived-to-base class through a virtual class, we don't have to get the vbase offset from the vtable if the derived class is marked final.
llvm-svn: 124523
Diffstat (limited to 'clang/test/CodeGenCXX/derived-to-virtual-base-class-calls-final.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/derived-to-virtual-base-class-calls-final.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/derived-to-virtual-base-class-calls-final.cpp b/clang/test/CodeGenCXX/derived-to-virtual-base-class-calls-final.cpp new file mode 100644 index 00000000000..e332f402000 --- /dev/null +++ b/clang/test/CodeGenCXX/derived-to-virtual-base-class-calls-final.cpp @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s + +struct A { int i; }; +struct B { int j; }; +struct C : A, B { int k; }; + +struct D final : virtual C { + D(); + virtual void f(); +}; + +// CHECK: define %struct.B* @_Z1fR1D +B &f(D &d) { + // CHECK-NOT: load i8** + return d; +} |