diff options
author | Timur Iskhodzhanov <timurrrr@google.com> | 2014-09-12 15:21:44 +0000 |
---|---|---|
committer | Timur Iskhodzhanov <timurrrr@google.com> | 2014-09-12 15:21:44 +0000 |
commit | e9ead73cdbb004d6ae879db904cab1e0a8a47464 (patch) | |
tree | b450478b52da77ed07fdb6368baeafb7fba88c18 /clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-return-adjustment.cpp | |
parent | 4c51f495b98ba1d8cff26fc36d2a55e5806c2c9f (diff) | |
download | bcm5719-llvm-e9ead73cdbb004d6ae879db904cab1e0a8a47464.tar.gz bcm5719-llvm-e9ead73cdbb004d6ae879db904cab1e0a8a47464.zip |
Add a previously-missing test case for return adjustment vs pure virtual methods
llvm-svn: 217686
Diffstat (limited to 'clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-return-adjustment.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-return-adjustment.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-return-adjustment.cpp b/clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-return-adjustment.cpp index 2f46609d097..232c0d9c4dd 100644 --- a/clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-return-adjustment.cpp +++ b/clang/test/CodeGenCXX/microsoft-abi-vtables-multiple-nonvirtual-inheritance-return-adjustment.cpp @@ -296,6 +296,30 @@ struct X : E { void build_vftable(X *obj) { obj->foo(); } } +namespace test7 { +struct A { + virtual A *f() = 0; +}; +struct B { + virtual void g(); +}; +struct C : B, A { + virtual void g(); + virtual C *f() = 0; + // CHECK-LABEL: VFTable for 'test7::B' in 'test7::C' (1 entry). + // CHECK-NEXT: 0 | void test7::C::g() + + // CHECK-LABEL: VFTable for 'test7::A' in 'test7::C' (2 entries). + // CHECK-NEXT: 0 | test7::C *test7::C::f() [pure] + // CHECK-NEXT: 1 | test7::C *test7::C::f() [pure] + + // No return adjusting thunks needed for pure virtual methods. + // CHECK-NOT: Thunks for 'test7::C *test7::C::f()' +}; + +void build_vftable(C *obj) { obj->g(); } +} + namespace pr20444 { struct A { virtual A* f(); |