llvm-6502/test/FrontendC/2008-08-07-AlignPadding1.c
Duncan Sands bb8f59003c Remove explicit uses of -emit-llvm, the test infrastructure adds it
automatically.  Use -S with llvm-gcc rather than -c, so tests can
work when llvm-gcc is really dragonegg (which can output IR with -S
but not -c).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120158 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-25 21:24:35 +00:00

30 lines
926 B
C

/* RUN: %llvmgcc %s -S -o - -O0 | grep {zeroinitializer.*zeroinitializer.*zeroinitializer.*zeroinitializer.*zeroinitializer.*zeroinitializer}
The FE must generate padding here both at the end of each PyG_Head and
between array elements. Reduced from Python. */
typedef union _gc_head {
struct {
union _gc_head *gc_next;
union _gc_head *gc_prev;
long gc_refs;
} gc;
int dummy __attribute__((aligned(16)));
} PyGC_Head;
struct gc_generation {
PyGC_Head head;
int threshold;
int count;
};
#define GEN_HEAD(n) (&generations[n].head)
/* linked lists of container objects */
static struct gc_generation generations[3] = {
/* PyGC_Head, threshold, count */
{{{GEN_HEAD(0), GEN_HEAD(0), 0}}, 700, 0},
{{{GEN_HEAD(1), GEN_HEAD(1), 0}}, 10, 0},
{{{GEN_HEAD(2), GEN_HEAD(2), 0}}, 10, 0},
};