diff options
-rw-r--r-- | test/CodeGenCXX/vtable-available-externally.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/CodeGenCXX/vtable-available-externally.cpp b/test/CodeGenCXX/vtable-available-externally.cpp index f56e3d147f..23baac968c 100644 --- a/test/CodeGenCXX/vtable-available-externally.cpp +++ b/test/CodeGenCXX/vtable-available-externally.cpp @@ -2,6 +2,7 @@ // RUN: FileCheck --check-prefix=CHECK-TEST1 %s < %t // RUN: FileCheck --check-prefix=CHECK-TEST2 %s < %t // RUN: FileCheck --check-prefix=CHECK-TEST5 %s < %t +// RUN: FileCheck --check-prefix=CHECK-TEST7 %s < %t #include <typeinfo> @@ -144,3 +145,27 @@ struct D : C { D::D() { } } + +namespace Test7 { + +struct c1 {}; +struct c10 : c1{ + virtual void foo (); +}; +struct c11 : c10, c1{ + virtual void f6 (); +}; +struct c28 : virtual c11{ + void f6 (); +}; + +// CHECK-TEST7: define void @_ZN5Test79check_c28Ev +// CHECK-TEST7: call void @_ZN5Test73c282f6Ev +// CHECK-TEST7: ret void +void check_c28 () { + c28 obj; + c11 *ptr = &obj; + ptr->f6 (); +} + +} |