aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/mem2reg/global-pointer.c
blob: d312577a32301502e69464c77a6676cf37847098 (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
int a, c, d;

int foo_ptr(void)
{
	int b, *bp = &b;
	int e, *ep = &e;

	if (a)
		*bp = c;
	else
		*bp = d;
	if (c)
		a = *bp;
	if (b)
		e = a;
	return e;
}

/*
 * check-name: global pointer
 * check-command: test-linearize -Wno-decl -fdump-ir=mem2reg $file
 * check-known-to-fail
 * check-output-ignore
 * check-output-pattern(4,5): load\\.
 * check-output-pattern(3): store\\.
 */