1 // Testcase for PR1242
2 // RUN: %clang_cc1 -emit-llvm %s -o - | grep datalayout | \
3 // RUN: not grep {"\[Ee\]-p:\[36\]\[24\]:\[36\]\[24\]"}
4 // END.
5
6 typedef __SIZE_TYPE__ size_t;
7 void * malloc(size_t size);
8 #define NDIM 3
9 #define BODY 01
10 typedef double vector[NDIM];
11 typedef struct bnode* bodyptr;
12 // { i16, double, [3 x double], i32, i32, [3 x double], [3 x double], [3 x
13 // double], double, \2 *, \2 * }
14 struct bnode {
15 short int type;
16 double mass;
17 vector pos;
18 int proc;
19 int new_proc;
20 vector vel;
21 vector acc;
22 vector new_acc;
23 double phi;
24 bodyptr next;
25 bodyptr proc_next;
26 } body;
27
28 #define Type(x) ((x)->type)
29 #define Mass(x) ((x)->mass)
30 #define Pos(x) ((x)->pos)
31 #define Proc(x) ((x)->proc)
32 #define New_Proc(x) ((x)->new_proc)
33 #define Vel(x) ((x)->vel)
34 #define Acc(x) ((x)->acc)
35 #define New_Acc(x) ((x)->new_acc)
36 #define Phi(x) ((x)->phi)
37 #define Next(x) ((x)->next)
38 #define Proc_Next(x) ((x)->proc_next)
39
ubody_alloc(int p)40 bodyptr ubody_alloc(int p)
41 {
42 register bodyptr tmp;
43 tmp = (bodyptr)malloc(sizeof(body));
44
45 Type(tmp) = BODY;
46 Proc(tmp) = p;
47 Proc_Next(tmp) = NULL;
48 New_Proc(tmp) = p;
49 return tmp;
50 }
51
main(int argc,char ** argv)52 int main(int argc, char** argv) {
53 bodyptr b = ubody_alloc(17);
54 return 0;
55 }
56