xref: /illumos-gate/usr/src/tools/smatch/src/validation/sm_range1.c (revision 20a7641f9918de8574b8b3b47dbe35c4bfc78df1)
1 struct ture {
2 	int x;
3 };
4 
5 struct ture *p;
6 struct ture *q;
7 int xxx;
8 
9 int func (void)
10 {
11 
12 	for (xxx = 0; xxx < 10; xxx++) {
13 		if (p && q)
14 			break;
15 	}
16 // this needs two pass processing to work.
17 //	if (xxx == 5)
18 //		q->x = 1;
19 	if (xxx == 10)
20 		return;
21 	p->x = 1;
22 
23 	return 0;
24 }
25 
26 /*
27  * check-name: Implied Ranges #1
28  * check-command: smatch sm_range1.c
29  */
30