Don't run lli in llvm-test. Instead just check that the datalayout string
[oota-llvm.git] / test / CFrontend / 2007-03-05-DataLayout.c
1 // Testcase for PR1242
2 // RUN: %llvmgcc -S %s -o - | grep datalayout | wc -c | grep 130
3 #include <stdlib.h>
4 #define NDIM 3
5 #define BODY 01
6 typedef double vector[NDIM];
7 typedef struct bnode* bodyptr;
8 // { i16, double, [3 x double], i32, i32, [3 x double], [3 x double], [3 x
9 // double], double, \2 *, \2 * }
10 struct bnode {
11   short int type;
12   double mass;
13   vector pos;
14   int proc;
15   int new_proc;
16   vector vel;
17   vector acc;
18   vector new_acc;
19   double phi;
20   bodyptr next;
21   bodyptr proc_next;
22 } body;
23
24 #define Type(x) ((x)->type)
25 #define Mass(x) ((x)->mass)
26 #define Pos(x)  ((x)->pos)
27 #define Proc(x) ((x)->proc)
28 #define New_Proc(x) ((x)->new_proc)
29 #define Vel(x)  ((x)->vel)
30 #define Acc(x)  ((x)->acc)
31 #define New_Acc(x)  ((x)->new_acc)
32 #define Phi(x)  ((x)->phi)
33 #define Next(x) ((x)->next)
34 #define Proc_Next(x) ((x)->proc_next)
35
36 bodyptr ubody_alloc(int p)
37
38   register bodyptr tmp;
39   tmp = (bodyptr)malloc(sizeof(body));
40
41   Type(tmp) = BODY;
42   Proc(tmp) = p;
43   Proc_Next(tmp) = NULL;
44   New_Proc(tmp) = p;
45   return tmp;
46 }
47
48 int main(int argc, char** argv) {
49   bodyptr b = ubody_alloc(17);
50   return 0;
51 }