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/] [991118-1.c] - Blame information for rev 308

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

Line No. Rev Author Line
1 297 jeremybenn
struct tmp
2
{
3
  long long int pad : 12;
4
  long long int field : 52;
5
};
6
 
7
struct tmp2
8
{
9
  long long int field : 52;
10
  long long int pad : 12;
11
};
12
 
13
struct tmp3
14
{
15
  long long int pad : 11;
16
  long long int field : 53;
17
};
18
 
19
struct tmp4
20
{
21
  long long int field : 53;
22
  long long int pad : 11;
23
};
24
 
25
struct tmp
26
sub (struct tmp tmp)
27
{
28
  tmp.field ^= 0x0008765412345678LL;
29
  return tmp;
30
}
31
 
32
struct tmp2
33
sub2 (struct tmp2 tmp2)
34
{
35
  tmp2.field ^= 0x0008765412345678LL;
36
  return tmp2;
37
}
38
 
39
struct tmp3
40
sub3 (struct tmp3 tmp3)
41
{
42
  tmp3.field ^= 0x0018765412345678LL;
43
  return tmp3;
44
}
45
 
46
struct tmp4
47
sub4 (struct tmp4 tmp4)
48
{
49
  tmp4.field ^= 0x0018765412345678LL;
50
  return tmp4;
51
}
52
 
53
struct tmp tmp = {0x123, 0x123456789ABCDLL};
54
struct tmp2 tmp2 = {0x123456789ABCDLL, 0x123};
55
struct tmp3 tmp3 = {0x123, 0x1FFFF00000000LL};
56
struct tmp4 tmp4 = {0x1FFFF00000000LL, 0x123};
57
 
58
main()
59
{
60
 
61
  if (sizeof (long long) != 8)
62
    exit (0);
63
 
64
  tmp = sub (tmp);
65
  tmp2 = sub2 (tmp2);
66
 
67
  if (tmp.pad != 0x123 || tmp.field != 0xFFF9551175BDFDB5LL)
68
    abort ();
69
  if (tmp2.pad != 0x123 || tmp2.field != 0xFFF9551175BDFDB5LL)
70
    abort ();
71
 
72
  tmp3 = sub3 (tmp3);
73
  tmp4 = sub4 (tmp4);
74
  if (tmp3.pad != 0x123 || tmp3.field != 0xFFF989AB12345678LL)
75
    abort ();
76
  if (tmp4.pad != 0x123 || tmp4.field != 0xFFF989AB12345678LL)
77
    abort ();
78
  exit (0);
79
}

powered by: WebSVN 2.1.0

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