mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-17 08:36:52 +00:00
round zero-byte .zerofill directives up to 1 byte. This
should fix some "g++.dg-struct-layout-1" failures, rdar://7886017 llvm-svn: 102421
This commit is contained in:
parent
eee2e72653
commit
a9c1328501
@ -283,6 +283,8 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
|
||||
// Handle the zerofill directive on darwin, which is a special form of BSS
|
||||
// emission.
|
||||
if (GVKind.isBSSExtern() && MAI->hasMachoZeroFillDirective()) {
|
||||
if (Size == 0) Size = 1; // zerofill of 0 bytes is undefined.
|
||||
|
||||
// .globl _foo
|
||||
OutStreamer.EmitSymbolAttribute(GVSym, MCSA_Global);
|
||||
// .zerofill __DATA, __common, _foo, 400, 5
|
||||
|
@ -144,3 +144,17 @@
|
||||
; LINUX: G10:
|
||||
; LINUX: .zero 400
|
||||
|
||||
|
||||
|
||||
;; Zero sized objects should round up to 1 byte in zerofill directives.
|
||||
; rdar://7886017
|
||||
@G11 = global [0 x i32] zeroinitializer
|
||||
@G12 = global {} zeroinitializer
|
||||
@G13 = global { [0 x {}] } zeroinitializer
|
||||
|
||||
; DARWIN: .globl _G11
|
||||
; DARWIN: .zerofill __DATA,__common,_G11,1,2
|
||||
; DARWIN: .globl _G12
|
||||
; DARWIN: .zerofill __DATA,__common,_G12,1,3
|
||||
; DARWIN: .globl _G13
|
||||
; DARWIN: .zerofill __DATA,__common,_G13,1,3
|
||||
|
Loading…
Reference in New Issue
Block a user