aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/mem2reg/global-loop.c
blob: a232f7edf8bc05b6c6e7818f45d4c11e04ef744d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
struct s {
	int c;
	int a[];
} s;
int f;

void fun(void);
void foo(void)
{
	for (f = 1;;)
		if (s.a[f])
			fun();
}

/*
 * check-name: global var as loop index
 * check-command: test-linearize -Wno-decl -fdump-ir=mem2reg $file
 * check-output-ignore
 * check-output-contains: load\\..*\\[f\\]
 */