ufoo(unsigned int a)1*c85f09ccSJohn Levon int ufoo(unsigned int a)
2*c85f09ccSJohn Levon {
3*c85f09ccSJohn Levon 	struct u {
4*c85f09ccSJohn Levon 		unsigned int :2;
5*c85f09ccSJohn Levon 		unsigned int a:3;
6*c85f09ccSJohn Levon 	} bf;
7*c85f09ccSJohn Levon 
8*c85f09ccSJohn Levon 	bf.a = a;
9*c85f09ccSJohn Levon 	return bf.a;
10*c85f09ccSJohn Levon }
11*c85f09ccSJohn Levon 
sfoo(int a)12*c85f09ccSJohn Levon int sfoo(int a)
13*c85f09ccSJohn Levon {
14*c85f09ccSJohn Levon 	struct s {
15*c85f09ccSJohn Levon 		signed int :2;
16*c85f09ccSJohn Levon 		signed int a:3;
17*c85f09ccSJohn Levon 	} bf;
18*c85f09ccSJohn Levon 
19*c85f09ccSJohn Levon 	bf.a = a;
20*c85f09ccSJohn Levon 	return bf.a;
21*c85f09ccSJohn Levon }
22*c85f09ccSJohn Levon 
23*c85f09ccSJohn Levon /*
24*c85f09ccSJohn Levon  * check-name: optim store/load bitfields
25*c85f09ccSJohn Levon  * check-command: test-linearize -Wno-decl $file
26*c85f09ccSJohn Levon  *
27*c85f09ccSJohn Levon  * check-output-start
28*c85f09ccSJohn Levon ufoo:
29*c85f09ccSJohn Levon .L0:
30*c85f09ccSJohn Levon 	<entry-point>
31*c85f09ccSJohn Levon 	and.32      %r11 <- %arg1, $7
32*c85f09ccSJohn Levon 	ret.32      %r11
33*c85f09ccSJohn Levon 
34*c85f09ccSJohn Levon 
35*c85f09ccSJohn Levon sfoo:
36*c85f09ccSJohn Levon .L2:
37*c85f09ccSJohn Levon 	<entry-point>
38*c85f09ccSJohn Levon 	trunc.3     %r16 <- (32) %arg1
39*c85f09ccSJohn Levon 	sext.32     %r23 <- (3) %r16
40*c85f09ccSJohn Levon 	ret.32      %r23
41*c85f09ccSJohn Levon 
42*c85f09ccSJohn Levon 
43*c85f09ccSJohn Levon  * check-output-end
44*c85f09ccSJohn Levon  */
45