3 struct S
{ unsigned char b
, g
, r
, a
; };
4 union U
{ struct S c
; unsigned v
; };
6 static inline unsigned char
7 foo (unsigned char a
, unsigned char b
)
9 return ((a
+ 1) * b
) >> 8;
12 __attribute__((noinline
, noclone
)) unsigned
13 bar (union U
*x
, union U
*y
)
16 unsigned char v
= x
->c
.a
;
17 unsigned char w
= foo (y
->c
.a
, 255 - v
);
18 z
.c
.r
= foo (x
->c
.r
, v
) + foo (y
->c
.r
, w
);
19 z
.c
.g
= foo (x
->c
.g
, v
) + foo (y
->c
.g
, w
);
20 z
.c
.b
= foo (x
->c
.b
, v
) + foo (y
->c
.b
, w
);
29 if ((unsigned char) ~0 != 255 || sizeof (unsigned) != 4)
31 a
.c
= (struct S
) { 255, 255, 255, 0 };
32 b
.c
= (struct S
) { 255, 255, 255, 255 };
34 if (c
.c
.b
!= 255 || c
.c
.g
!= 255 || c
.c
.r
!= 255 || c
.c
.a
!= 0)