1
0
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:
Lauro Ramos Venancio 2007-07-11 19:56:53 +00:00
parent 02e2152d02
commit a126bb71d5
2 changed files with 13 additions and 1 deletions
lib/Target/CBackend
test/CodeGen/CBackend

@ -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: {

@ -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
}