diff options
| author | Dale Johannesen <dalej@apple.com> | 2008-08-08 03:37:11 +0000 |
|---|---|---|
| committer | Dale Johannesen <dalej@apple.com> | 2008-08-08 03:37:11 +0000 |
| commit | 3b45982c7860df0ef4249abc2c6eb2a196da2921 (patch) | |
| tree | 29bb0d7ca088be4361764d940224b3b4f76bae89 /llvm/test/FrontendC/2008-08-07-AlignPadding1.c | |
| parent | dcb5e38927a9ffd7daa82ac205e8a8ee06b8321c (diff) | |
| download | bcm5719-llvm-3b45982c7860df0ef4249abc2c6eb2a196da2921.tar.gz bcm5719-llvm-3b45982c7860df0ef4249abc2c6eb2a196da2921.zip | |
Testcases for 54503. One derived from PR 2533, the
other from Python.
llvm-svn: 54505
Diffstat (limited to 'llvm/test/FrontendC/2008-08-07-AlignPadding1.c')
| -rw-r--r-- | llvm/test/FrontendC/2008-08-07-AlignPadding1.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/llvm/test/FrontendC/2008-08-07-AlignPadding1.c b/llvm/test/FrontendC/2008-08-07-AlignPadding1.c new file mode 100644 index 00000000000..7d7df4a8ad1 --- /dev/null +++ b/llvm/test/FrontendC/2008-08-07-AlignPadding1.c @@ -0,0 +1,29 @@ +/* RUN: %llvmgcc %s -m64 -S -o - -emit-llvm -O0 | grep zeroinitializer | count 6 + +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}, +}; |

