2 bitfld-3.c from the execute part of the gcc torture tests.
7 /* Test that operations on bit-fields yield results reduced to bit-field
9 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
10 #if 0 // Enable when SDCC supports bit-fields wider than 16 bits
13 unsigned long long u33
: 33;
14 unsigned long long u40
: 40;
15 unsigned long long u41
: 41;
18 struct s a
= { 0x100000, 0x100000, 0x100000 };
19 struct s b
= { 0x100000000ULL
, 0x100000000ULL
, 0x100000000ULL
};
20 struct s c
= { 0x1FFFFFFFFULL
, 0, 0 };
24 testTortureExecute (void)
26 #if 0 // Enable when SDCC supports bit-fields wider than 16 bits
27 if (a
.u33
* a
.u33
!= 0 || a
.u33
* a
.u40
!= 0 || a
.u40
* a
.u33
!= 0
28 || a
.u40
* a
.u40
!= 0)
30 if (a
.u33
* a
.u41
!= 0x10000000000ULL
31 || a
.u40
* a
.u41
!= 0x10000000000ULL
32 || a
.u41
* a
.u33
!= 0x10000000000ULL
33 || a
.u41
* a
.u40
!= 0x10000000000ULL
34 || a
.u41
* a
.u41
!= 0x10000000000ULL
)
36 if (b
.u33
+ b
.u33
!= 0)
38 if (b
.u33
+ b
.u40
!= 0x200000000ULL
39 || b
.u33
+ b
.u41
!= 0x200000000ULL
40 || b
.u40
+ b
.u33
!= 0x200000000ULL
41 || b
.u40
+ b
.u40
!= 0x200000000ULL
42 || b
.u40
+ b
.u41
!= 0x200000000ULL
43 || b
.u41
+ b
.u33
!= 0x200000000ULL
44 || b
.u41
+ b
.u40
!= 0x200000000ULL
45 || b
.u41
+ b
.u41
!= 0x200000000ULL
)
47 if (a
.u33
- b
.u33
!= 0x100100000ULL
48 || a
.u33
- b
.u40
!= 0xFF00100000ULL
49 || a
.u33
- b
.u41
!= 0x1FF00100000ULL
50 || a
.u40
- b
.u33
!= 0xFF00100000ULL
51 || a
.u40
- b
.u40
!= 0xFF00100000ULL
52 || a
.u40
- b
.u41
!= 0x1FF00100000ULL
53 || a
.u41
- b
.u33
!= 0x1FF00100000ULL
54 || a
.u41
- b
.u40
!= 0x1FF00100000ULL
55 || a
.u41
- b
.u41
!= 0x1FF00100000ULL
)
57 if (++c
.u33
!= 0 || --c
.u40
!= 0xFFFFFFFFFFULL
|| c
.u41
-- != 0)