xref: /illumos-gate/usr/src/tools/smatch/src/validation/mem2reg/global-loop.c (revision b531f6d16eb39863e7bbc34773fb7ef7a282a0a2)
1 struct s {
2 	int c;
3 	int a[];
4 } s;
5 int f;
6 
7 void fun(void);
8 void foo(void)
9 {
10 	for (f = 1;;)
11 		if (s.a[f])
12 			fun();
13 }
14 
15 /*
16  * check-name: global var as loop index
17  * check-command: test-linearize -Wno-decl -fdump-ir=mem2reg $file
18  * check-output-ignore
19  * check-output-contains: load\\..*\\[f\\]
20  */
21