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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [compat/] [struct-align.c] - Blame information for rev 816

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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