summaryrefslogtreecommitdiff
path: root/test/FrontendC/2008-08-07-AlignPadding1.c
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-08-08 03:37:11 +0000
committerDale Johannesen <dalej@apple.com>2008-08-08 03:37:11 +0000
commitea98fe2cd2339da2292662c2261b88f38c945cd0 (patch)
treebfd1344c57d87f8b5c54265b099234d530ee675c /test/FrontendC/2008-08-07-AlignPadding1.c
parentfb224a20bc3a0a95e8799ce443f91498f65914ac (diff)
downloadllvm-ea98fe2cd2339da2292662c2261b88f38c945cd0.tar.gz
llvm-ea98fe2cd2339da2292662c2261b88f38c945cd0.tar.bz2
llvm-ea98fe2cd2339da2292662c2261b88f38c945cd0.tar.xz
Testcases for 54503. One derived from PR 2533, the
other from Python. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54505 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/FrontendC/2008-08-07-AlignPadding1.c')
-rw-r--r--test/FrontendC/2008-08-07-AlignPadding1.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/FrontendC/2008-08-07-AlignPadding1.c b/test/FrontendC/2008-08-07-AlignPadding1.c
new file mode 100644
index 0000000000..7d7df4a8ad
--- /dev/null
+++ b/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},
+};