mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-11 00:39:36 +00:00
Handle packed structs in the CBackend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39752 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
02e2152d02
commit
a126bb71d5
@ -466,7 +466,10 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty,
|
||||
printType(Out, *I, false, "field" + utostr(Idx++));
|
||||
Out << ";\n";
|
||||
}
|
||||
return Out << '}';
|
||||
Out << '}';
|
||||
if (STy->isPacked())
|
||||
Out << " __attribute__ ((packed))";
|
||||
return Out;
|
||||
}
|
||||
|
||||
case Type::PointerTyID: {
|
||||
|
9
test/CodeGen/CBackend/2007-07-11-PackedStruct.ll
Normal file
9
test/CodeGen/CBackend/2007-07-11-PackedStruct.ll
Normal file
@ -0,0 +1,9 @@
|
||||
; RUN: llvm-as < %s | llc -march=c | grep {packed}
|
||||
|
||||
%struct.p = type <{ i16 }>
|
||||
|
||||
define i32 @main() {
|
||||
entry:
|
||||
%t = alloca %struct.p, align 2
|
||||
ret i32 5
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user