Before determining the effect the alignment of base struct will have in the aligment of the sub-struct,
take into account if the sub-struct is packed and its maximum field alignment.
Fixes rdar://8745206
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121335 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/pragma-pack.cpp b/test/SemaCXX/pragma-pack.cpp
new file mode 100644
index 0000000..c388bd4
--- /dev/null
+++ b/test/SemaCXX/pragma-pack.cpp
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -triple i686-apple-darwin9 -fsyntax-only -verify %s
+
+namespace rdar8745206 {
+
+struct Base {
+ int i;
+};
+
+#pragma pack(1)
+struct Sub : public Base {
+ char c;
+};
+
+int check[sizeof(Sub) == 5 ? 1 : -1];
+
+}