OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [compat/] [strct-layout.c] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
typedef struct
2
{
3
  char a;
4
  int b;
5
  char c;
6
  short d;
7
  double e;
8
  char f;
9
} T;
10
 
11
#if COMPILER != 1
12
f (T *x)
13
{
14
  x[0].a = 'a';
15
  x[0].b = 47114711;
16
  x[0].c = 'c';
17
  x[0].d = 1234;
18
  x[0].e = 3.141592897932;
19
  x[0].f = '*';
20
 
21
  x[1].a = 'A';
22
  x[1].b = 71417141;
23
  x[1].c = 'C';
24
  x[1].d = 4321;
25
  x[1].e = 2.718281828459;
26
  x[1].f = '?';
27
}
28
#endif
29
 
30
#if COMPILER != 2
31
g (T *x)
32
{
33
  if (x[0].a != 'a')
34
    abort ();
35
  if (x[0].b != 47114711)
36
    abort ();
37
  if (x[0].c != 'c')
38
    abort ();
39
  if (x[0].d != 1234)
40
    abort ();
41
  if (x[0].e != 3.141592897932)
42
    abort ();
43
  if (x[0].f != '*')
44
    abort ();
45
 
46
  if (x[1].a != 'A')
47
    abort ();
48
  if (x[1].b != 71417141)
49
    abort ();
50
  if (x[1].c != 'C')
51
    abort ();
52
  if (x[1].d != 4321)
53
    abort ();
54
  if (x[1].e != 2.718281828459)
55
    abort ();
56
  if (x[1].f != '?')
57
    abort ();
58
}
59
#endif
60
 
61
#if COMPILER != 2
62
main ()
63
{
64
  T x[2];
65
  f (x);
66
  g (x);
67
  exit (0);
68
}
69
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.