From 976d91177a83101434c1985ea3b14f682f0f38c4 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sun, 6 Feb 2011 20:16:20 +0000 Subject: [PATCH] Add another test that we can fully devirtualize now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124988 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../vtable-available-externally.cpp | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) 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 @@ -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 (); +} + +} -- 2.40.0