aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/optim/lsr-to-asr.c
blob: 26927739642974b61e0f29511782e09b1ba19f10 (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
int lsr_to_asr24(int x)
{
	return ((signed char)(((unsigned)x) >> 24)) == (x >> 24);
}


struct s {
	int :30;
	signed int f:2;
};

int lsr_to_asr30(int a)
{
	union {
		int i;
		struct s s;
	} u = { .i = a };
	return u.s.f == (a >> 30);
}

/*
 * check-name: lsr-to-asr
 * check-command: test-linearize -Wno-decl $file
 *
 * check-output-ignore
 * check-output-returns: 1
 */