struct may cause it to shrink more than one byte. Before
my recent changes we compiled the new test into:
%0 = type { [6 x i8] }
@x = global %0 { [6 x i8] undef }, align 2 ; <%0*> [#uses=0]
which is obviously bogus. Now we compile it into:
%0 = type <{ i32, i8, i8 }>
@x = global %0 zeroinitializer, align 2 ; <%0*> [#uses=0]
Where the last byte only is tail padding.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101536
91177308-0d34-0410-b5e6-
96231b3b80d8
assert(!Packed && "Size mismatch!");
ConvertStructToPacked();
- assert(NextFieldOffsetInBytes == LayoutSizeInBytes &&
+ assert(NextFieldOffsetInBytes <= LayoutSizeInBytes &&
"Converting to packed did not help!");
}
{4},
};
+// rdar://7872531
+#pragma pack(push, 2)
+struct test8s { int f0; char f1; } test8g = {};
+
+