aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/optim/store-load-bitfield.c
blob: f68cb60004f59784144fb1d9f8fb390a84df228a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
int ufoo(unsigned int a)
{
	struct u {
		unsigned int :2;
		unsigned int a:3;
	} bf;

	bf.a = a;
	return bf.a;
}

int sfoo(int a)
{
	struct s {
		signed int :2;
		signed int a:3;
	} bf;

	bf.a = a;
	return bf.a;
}

/*
 * check-name: optim store/load bitfields
 * check-command: test-linearize -Wno-decl $file
 *
 * check-output-start
ufoo:
.L0:
	<entry-point>
	and.32      %r11 <- %arg1, $7
	ret.32      %r11


sfoo:
.L2:
	<entry-point>
	trunc.3     %r16 <- (32) %arg1
	sext.32     %r23 <- (3) %r16
	ret.32      %r23


 * check-output-end
 */