mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 11:06:08 +00:00

This reverts commit r220169 which reverted r220153. However, it also contains additional changes: - We may need to add padding *after* we've packed the struct. This occurs when the aligned next field offset is greater than the new field's offset. When this occurs, we make the struct packed. *However*, once packed the next field offset might be less than the new feild's offset. It is in this case that we might further pad the struct. - We would pad structs which were perfectly sized! This behavior is immensely old. This behavior came from blindly subtracting NextFieldOffsetInChars from RecordSize. This doesn't take into account the fact that the struct might have a greater overall alignment than the last field. llvm-svn: 220175
12 lines
227 B
C
12 lines
227 B
C
// RUN: %clang_cc1 -triple=i686-apple-darwin9 -emit-llvm -o - %s | FileCheck %s
|
|
|
|
struct et7 {
|
|
float lv7[0];
|
|
char mv7:6;
|
|
} yv7 = {
|
|
{},
|
|
52,
|
|
};
|
|
|
|
// CHECK: @yv7 = global %struct.et7 { [0 x float] zeroinitializer, i8 52 }
|