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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [compat/] [struct-big.c] - Blame information for rev 298

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

Line No. Rev Author Line
1 297 jeremybenn
typedef struct {int a, b, c, d, e;} T;
2
 
3
int h (T *);
4
T g (T);
5
 
6
#if COMPILER != 1
7
h (T *x)
8
{
9
  if (x->a != 0 || x->b != 1 || x->c != 2 || x->d != 3 || x->e != 4)
10
    abort ();
11
}
12
#endif
13
 
14
#if COMPILER != 2
15
T
16
g (T x)
17
{
18
  if (x.a != 13 || x.b != 47 || x.c != 123456 || x.d != -4711 || x.e != -2)
19
    abort ();
20
  x.a = 0;
21
  x.b = 1;
22
  x.c = 2;
23
  x.d = 3;
24
  x.e = 4;
25
  h (&x);
26
  return x;
27
}
28
#endif
29
 
30
#if COMPILER != 1
31
f ()
32
{
33
  T x;
34
  x.a = 13;
35
  x.b = 47;
36
  x.c = 123456;
37
  x.d = -4711;
38
  x.e = -2;
39
  g (x);
40
  if (x.a != 13 || x.b != 47 || x.c != 123456 || x.d != -4711 || x.e != -2)
41
    abort ();
42
  x = g (x);
43
  if (x.a != 0 || x.b != 1 || x.c != 2 || x.d != 3 || x.e != 4)
44
    abort ();
45
}
46
#endif
47
 
48
#if COMPILER != 2
49
main ()
50
{
51
  f ();
52
  exit (0);
53
}
54
#endif

powered by: WebSVN 2.1.0

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