summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/CodeGen/CGExprConstant.cpp2
-rw-r--r--clang/test/CodeGen/decl.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp
index 52e7d045e60..82156f72602 100644
--- a/clang/lib/CodeGen/CGExprConstant.cpp
+++ b/clang/lib/CodeGen/CGExprConstant.cpp
@@ -372,7 +372,7 @@ bool ConstStructBuilder::Build(InitListExpr *ILE) {
assert(!Packed && "Size mismatch!");
ConvertStructToPacked();
- assert(NextFieldOffsetInBytes == LayoutSizeInBytes &&
+ assert(NextFieldOffsetInBytes <= LayoutSizeInBytes &&
"Converting to packed did not help!");
}
diff --git a/clang/test/CodeGen/decl.c b/clang/test/CodeGen/decl.c
index 8bbeb24fe15..7ffb7006b05 100644
--- a/clang/test/CodeGen/decl.c
+++ b/clang/test/CodeGen/decl.c
@@ -84,3 +84,8 @@ struct test7s { int a; int b; } test7[] = {
{4},
};
+// rdar://7872531
+#pragma pack(push, 2)
+struct test8s { int f0; char f1; } test8g = {};
+
+
OpenPOWER on IntegriCloud