Context.getTypeInfo(FD->getType());
uint64_t TypeSize = FieldInfo.first;
unsigned FieldAlign = FieldInfo.second;
+ // This check is needed for 'long long' in -m32 mode.
+ if (TypeSize > FieldAlign)
+ FieldAlign = TypeSize;
FieldInfo = Context.getTypeInfo(LastFD->getType());
uint64_t TypeSizeLastFD = FieldInfo.first;
unsigned FieldAlignLastFD = FieldInfo.second;
+ // This check is needed for 'long long' in -m32 mode.
+ if (TypeSizeLastFD > FieldAlignLastFD)
+ FieldAlignLastFD = TypeSizeLastFD;
if (TypeSizeLastFD != TypeSize) {
uint64_t UnpaddedFieldOffset =
getDataSizeInBits() - UnfilledBitsInLastByte;
uint64_t TypeSize = FieldInfo.first;
unsigned FieldAlign = FieldInfo.second;
+ // This check is needed for 'long long' in -m32 mode.
+ if (IsMsStruct && (TypeSize > FieldAlign))
+ FieldAlign = TypeSize;
+
if (ZeroLengthBitfield) {
// If a zero-length bitfield is inserted after a bitfield,
// and the alignment of the zero-length bitfield is
-// RUN: %clang_cc1 -emit-llvm-only -triple x86_64-apple-darwin9 %s
+// RUN: %clang_cc1 -emit-llvm-only -triple i386-apple-darwin9 %s
// rdar://8823265
#define ATTR __attribute__((__ms_struct__))
struct_1 test_struct_1 = { 18557917, 'a', 3, 'b' };
static int a1[(size_struct_1 == sizeof (struct_1)) -1];
+
+struct ten {
+ long long a:3;
+ long long b:3;
+ char c;
+} __attribute__ ((ms_struct));
+
+#define size_struct_2 16
+
+static int a2[(size_struct_2 == sizeof (struct ten)) -1];