Always emit vcall offset for the primary base, not only if it's virtual. Remove a debug printf, and add the test case that now passes.

llvm-svn: 96880
diff --git a/clang/lib/CodeGen/CGVtable.cpp b/clang/lib/CodeGen/CGVtable.cpp
index 52e82d9..93cd42c 100644
--- a/clang/lib/CodeGen/CGVtable.cpp
+++ b/clang/lib/CodeGen/CGVtable.cpp
@@ -1112,15 +1112,11 @@
 }
 
 void VtableBuilder::AddVCallOffsets(BaseSubobject Base, uint64_t VBaseOffset) {
-  printf("adding call offsets for (%s, %llu) vbase offset %llu\n",
-         Base.getBase()->getQualifiedNameAsString().c_str(),
-         Base.getBaseOffset(), VBaseOffset);
   const CXXRecordDecl *RD = Base.getBase();
   const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD);
 
   // Handle the primary base first.
-  const CXXRecordDecl *PrimaryBase = Layout.getPrimaryBase();
-  if (PrimaryBase && Layout.getPrimaryBaseWasVirtual()) {
+  if (const CXXRecordDecl *PrimaryBase = Layout.getPrimaryBase()) {
     // Get the base offset of the primary base.
     uint64_t PrimaryBaseOffset = Base.getBaseOffset() + 
       Layout.getBaseClassOffset(PrimaryBase);