xref: /illumos-gate/usr/src/tools/smatch/src/validation/sm_implied13.c (revision 1f5207b7604fb44407eb4342aff613f7c4508508)
1*1f5207b7SJohn Levon #include "check_debug.h"
2*1f5207b7SJohn Levon 
main(int x)3*1f5207b7SJohn Levon int main(int x)
4*1f5207b7SJohn Levon {
5*1f5207b7SJohn Levon 	int a = 1;
6*1f5207b7SJohn Levon 
7*1f5207b7SJohn Levon 	if (x & 12)
8*1f5207b7SJohn Levon 		a = 2;
9*1f5207b7SJohn Levon 	__smatch_implied(a);
10*1f5207b7SJohn Levon 	if (!(x & 12))
11*1f5207b7SJohn Levon 		return 0;
12*1f5207b7SJohn Levon 	__smatch_implied(a);
13*1f5207b7SJohn Levon 	return 0;
14*1f5207b7SJohn Levon }
15*1f5207b7SJohn Levon 
16*1f5207b7SJohn Levon /*
17*1f5207b7SJohn Levon  * check-name: smatch implied #13
18*1f5207b7SJohn Levon  * check-command: smatch -I.. sm_implied13.c
19*1f5207b7SJohn Levon  *
20*1f5207b7SJohn Levon  * check-output-start
21*1f5207b7SJohn Levon sm_implied13.c:9 main() implied: a = '1-2'
22*1f5207b7SJohn Levon sm_implied13.c:12 main() implied: a = '2'
23*1f5207b7SJohn Levon  * check-output-end
24*1f5207b7SJohn Levon  */
25