summaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/2007-03-05-DataLayout.c
diff options
context:
space:
mode:
authorCarlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au>2012-10-15 17:10:06 +1100
committerCarlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au>2012-10-15 17:10:06 +1100
commitbe1de4be954c80875ad4108e0a33e8e131b2f2c0 (patch)
tree1fbbecf276bf7c7bdcbb4dd446099d6d90eaa516 /clang/test/CodeGen/2007-03-05-DataLayout.c
parentc4626a62754862d20b41e8a46a3574264ea80e6d (diff)
parentf1bd2e48c5324d3f7cda4090c87f8a5b6f463ce2 (diff)
Merge branch 'master' of ssh://bitbucket.org/czan/honours
Diffstat (limited to 'clang/test/CodeGen/2007-03-05-DataLayout.c')
-rw-r--r--clang/test/CodeGen/2007-03-05-DataLayout.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/clang/test/CodeGen/2007-03-05-DataLayout.c b/clang/test/CodeGen/2007-03-05-DataLayout.c
new file mode 100644
index 0000000..7519624
--- /dev/null
+++ b/clang/test/CodeGen/2007-03-05-DataLayout.c
@@ -0,0 +1,55 @@
+// Testcase for PR1242
+// RUN: %clang_cc1 -emit-llvm %s -o - | grep datalayout | \
+// RUN: not grep {"\[Ee\]-p:\[36\]\[24\]:\[36\]\[24\]"}
+// END.
+
+typedef __SIZE_TYPE__ size_t;
+void * malloc(size_t size);
+#define NDIM 3
+#define BODY 01
+typedef double vector[NDIM];
+typedef struct bnode* bodyptr;
+// { i16, double, [3 x double], i32, i32, [3 x double], [3 x double], [3 x
+// double], double, \2 *, \2 * }
+struct bnode {
+ short int type;
+ double mass;
+ vector pos;
+ int proc;
+ int new_proc;
+ vector vel;
+ vector acc;
+ vector new_acc;
+ double phi;
+ bodyptr next;
+ bodyptr proc_next;
+} body;
+
+#define Type(x) ((x)->type)
+#define Mass(x) ((x)->mass)
+#define Pos(x) ((x)->pos)
+#define Proc(x) ((x)->proc)
+#define New_Proc(x) ((x)->new_proc)
+#define Vel(x) ((x)->vel)
+#define Acc(x) ((x)->acc)
+#define New_Acc(x) ((x)->new_acc)
+#define Phi(x) ((x)->phi)
+#define Next(x) ((x)->next)
+#define Proc_Next(x) ((x)->proc_next)
+
+bodyptr ubody_alloc(int p)
+{
+ register bodyptr tmp;
+ tmp = (bodyptr)malloc(sizeof(body));
+
+ Type(tmp) = BODY;
+ Proc(tmp) = p;
+ Proc_Next(tmp) = NULL;
+ New_Proc(tmp) = p;
+ return tmp;
+}
+
+int main(int argc, char** argv) {
+ bodyptr b = ubody_alloc(17);
+ return 0;
+}