Make this test more reliable across platforms.
[oota-llvm.git] / test / CFrontend / 2007-03-05-DataLayout.c
1 // Testcase for PR1242
2 // RUN: %llvmgcc -S %s -o - | grep datalayout | \
3 // RUN:    not grep '"[Ee]-p:[36][24]:[36]:[24]"'
4 #include <stdlib.h>
5 #define NDIM 3
6 #define BODY 01
7 typedef double vector[NDIM];
8 typedef struct bnode* bodyptr;
9 // { i16, double, [3 x double], i32, i32, [3 x double], [3 x double], [3 x
10 // double], double, \2 *, \2 * }
11 struct 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
37 bodyptr 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
49 int main(int argc, char** argv) {
50   bodyptr b = ubody_alloc(17);
51   return 0;
52 }