blob: 18819f16908098ac37012ef32f0a8bd0b9fc1ac2 [file] [log] [blame]
Reid Spencer7ca06892007-03-06 03:00:17 +00001// Testcase for PR1242
Reid Spencer230b8c22007-03-07 00:32:12 +00002// RUN: %llvmgcc -S %s -o - | grep datalayout | \
Reid Spencerdcb925e2007-04-15 20:08:37 +00003// RUN: not grep {"\[Ee\]-p:\[36\]\[24\]:\[36\]\[24\]"}
4// END.
Reid Spencer7ca06892007-03-06 03:00:17 +00005#include <stdlib.h>
6#define NDIM 3
7#define BODY 01
8typedef double vector[NDIM];
9typedef struct bnode* bodyptr;
10// { i16, double, [3 x double], i32, i32, [3 x double], [3 x double], [3 x
11// double], double, \2 *, \2 * }
12struct bnode {
13 short int type;
14 double mass;
15 vector pos;
16 int proc;
17 int new_proc;
18 vector vel;
19 vector acc;
20 vector new_acc;
21 double phi;
22 bodyptr next;
23 bodyptr proc_next;
24} body;
25
26#define Type(x) ((x)->type)
27#define Mass(x) ((x)->mass)
28#define Pos(x) ((x)->pos)
29#define Proc(x) ((x)->proc)
30#define New_Proc(x) ((x)->new_proc)
31#define Vel(x) ((x)->vel)
32#define Acc(x) ((x)->acc)
33#define New_Acc(x) ((x)->new_acc)
34#define Phi(x) ((x)->phi)
35#define Next(x) ((x)->next)
36#define Proc_Next(x) ((x)->proc_next)
37
38bodyptr ubody_alloc(int p)
39{
40 register bodyptr tmp;
41 tmp = (bodyptr)malloc(sizeof(body));
42
43 Type(tmp) = BODY;
44 Proc(tmp) = p;
45 Proc_Next(tmp) = NULL;
46 New_Proc(tmp) = p;
47 return tmp;
48}
49
50int main(int argc, char** argv) {
51 bodyptr b = ubody_alloc(17);
52 return 0;
53}