OSDN Git Service

* gcc.c-torture/execute/991118-1.c: New test.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / execute / 991118-1.c
1 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 tmp
14 sub (struct tmp tmp)
15 {
16   tmp.field ^= 0x0008765412345678LL;
17   return tmp;
18 }
19
20 struct tmp2
21 sub2 (struct tmp2 tmp2)
22 {
23   tmp2.field ^= 0x0008765412345678LL;
24   return tmp2;
25 }
26
27 struct tmp tmp = {0x123, 0x123456789ABCDLL};
28 struct tmp2 tmp2 = {0x123456789ABCDLL, 0x123};
29
30 main()
31 {
32
33   if (sizeof (long long) != 8)
34     exit (0);
35
36   tmp = sub (tmp);
37   tmp2 = sub2 (tmp2);
38
39   if (tmp.pad != 0x123 || tmp.field != 0xFFF9551175BDFDB5LL)
40     abort ();
41   if (tmp2.pad != 0x123 || tmp2.field != 0xFFF9551175BDFDB5LL)
42     abort ();
43   exit (0);
44 }
45