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/] [execute/] [921204-1.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
/* The bit-field below would have a problem if __INT_MAX__ is too
2
   small.  */
3
#if __INT_MAX__ < 2147483647
4
int
5
main (void)
6
{
7
  exit (0);
8
}
9
#else
10
typedef struct {
11
  unsigned b0:1, f1:17, b18:1, b19:1, b20:1, f2:11;
12
} bf;
13
 
14
typedef union {
15
  bf b;
16
  unsigned w;
17
} bu;
18
 
19
bu
20
f(bu i)
21
{
22
  bu o = i;
23
 
24
  if (o.b.b0)
25
    o.b.b18 = 1,
26
    o.b.b20 = 1;
27
  else
28
    o.b.b18 = 0,
29
    o.b.b20 = 0;
30
 
31
  return o;
32
}
33
 
34
main()
35
{
36
  bu a;
37
  bu r;
38
 
39
  a.w = 0x4000000;
40
  a.b.b0 = 0;
41
  r = f(a);
42
  if (a.w != r.w)
43
    abort();
44
  exit(0);
45
}
46
#endif

powered by: WebSVN 2.1.0

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