File: 2007-03-05-DataLayout.c

package info (click to toggle)
llvm 2.6-9.1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 57,604 kB
  • ctags: 44,336
  • sloc: cpp: 344,766; sh: 12,407; ansic: 10,617; ada: 3,070; ml: 2,505; perl: 2,496; makefile: 1,426; pascal: 1,163; exp: 389; asm: 307; python: 298; objc: 260; lisp: 182; csh: 117; xml: 38; f90: 36; tcl: 20
file content (53 lines) | stat: -rw-r--r-- 1,158 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Testcase for PR1242
// RUN: %llvmgcc -S %s -o - | grep datalayout | \
// RUN:    not grep {"\[Ee\]-p:\[36\]\[24\]:\[36\]\[24\]"}
// END.
#include <stdlib.h>
#define NDIM 3
#define BODY 01
typedef double vector[NDIM];
typedef struct bnode* bodyptr;
// { i16, double, [3 x double], i32, i32, [3 x double], [3 x double], [3 x
// double], double, \2 *, \2 * }
struct bnode {
  short int type;
  double mass;
  vector pos;
  int proc;
  int new_proc;
  vector vel;
  vector acc;
  vector new_acc;
  double phi;
  bodyptr next;
  bodyptr proc_next;
} body;

#define Type(x) ((x)->type)
#define Mass(x) ((x)->mass)
#define Pos(x)  ((x)->pos)
#define Proc(x) ((x)->proc)
#define New_Proc(x) ((x)->new_proc)
#define Vel(x)  ((x)->vel)
#define Acc(x)  ((x)->acc)
#define New_Acc(x)  ((x)->new_acc)
#define Phi(x)  ((x)->phi)
#define Next(x) ((x)->next)
#define Proc_Next(x) ((x)->proc_next)

bodyptr ubody_alloc(int p)
{ 
  register bodyptr tmp;
  tmp = (bodyptr)malloc(sizeof(body));

  Type(tmp) = BODY;
  Proc(tmp) = p;
  Proc_Next(tmp) = NULL;
  New_Proc(tmp) = p;
  return tmp;
}

int main(int argc, char** argv) {
  bodyptr b = ubody_alloc(17);
  return 0;
}