diff options
-rw-r--r-- | lib/CodeGen/CGExprConstant.cpp | 2 | ||||
-rw-r--r-- | test/CodeGen/bitfield-init.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index e618dab33e..1639ac0939 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -275,7 +275,7 @@ public: if (curField->isBitField()) { // Create a dummy struct for bit-field insertion - unsigned NumElts = CGM.getTargetData().getTypePaddedSize(Ty) / 8; + unsigned NumElts = CGM.getTargetData().getTypePaddedSize(Ty); llvm::Constant* NV = llvm::Constant::getNullValue(llvm::Type::Int8Ty); std::vector<llvm::Constant*> Elts(NumElts, NV); diff --git a/test/CodeGen/bitfield-init.c b/test/CodeGen/bitfield-init.c index f0cc0b1568..7459614a12 100644 --- a/test/CodeGen/bitfield-init.c +++ b/test/CodeGen/bitfield-init.c @@ -10,3 +10,5 @@ void sqlite3CodeSubselect(){ struct Token one = { 1 }; } +typedef union T0 { char field0 : 2; } T0; +T0 T0_values = { 0 }; |