When laying out bases in, always try the "base subobject" LLVM type. If it
turns out that a field or base needs to be laid out in the tail padding of
the base, CGRecordLayoutBuilder::ResizeLastBaseFieldIfNecessary will convert
it to an array of i8.

I've audited the new test results to make sure that they are still valid. I've
also verified that we pass a self-host with this change.

This (finally) fixes PR5589!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129673 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/pragma-pack.cpp b/test/CodeGenCXX/pragma-pack.cpp
index c0ddb1d..c0b0259 100644
--- a/test/CodeGenCXX/pragma-pack.cpp
+++ b/test/CodeGenCXX/pragma-pack.cpp
@@ -10,5 +10,7 @@
   char c;
 };
 
-// CHECK: %struct.Sub = type <{ i32 (...)**, i8, [8 x i8] }>
+// CHECK: %struct.Sub = type <{ i32 (...)**, i8, %struct.Base }>
 void f(Sub*) { }
+
+static int i[sizeof(Sub) == 13 ? 1 : -1];