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