xref: /illumos-gate/usr/src/tools/smatch/src/validation/sm_equiv3.c (revision 1da57d551424de5a9d469760be7c4b4d4f10a755)
1 #include "check_debug.h"
2 
3 int *something();
4 void frob();
5 
6 int red;
7 int blue;
8 int x;
9 int func(void)
10 {
11 
12 	red = something();
13 	if (x < 4)
14 		red = something();
15 	else if (x > 5)
16 		red = 0;
17 
18 	blue = red;
19 	red = 0;
20 	if (!blue)
21 		return;
22 	__smatch_value("red");
23 	__smatch_value("blue");
24 	return 0;
25 }
26 /*
27  * check-name: smatch equivalent variables #3
28  * check-command: smatch -I.. sm_equiv3.c
29  *
30  * check-output-start
31 sm_equiv3.c:22 func() red = 0
32 sm_equiv3.c:23 func() blue = s32min-(-1),1-s32max
33  * check-output-end
34  */
35