xref: /illumos-gate/usr/src/tools/smatch/src/validation/sm_absolute2.c (revision 1f5207b7604fb44407eb4342aff613f7c4508508)
1*1f5207b7SJohn Levon #include "check_debug.h"
2*1f5207b7SJohn Levon 
3*1f5207b7SJohn Levon static int my_var;
4*1f5207b7SJohn Levon 
5*1f5207b7SJohn Levon int x;
func(int * p)6*1f5207b7SJohn Levon int func(int *p)
7*1f5207b7SJohn Levon {
8*1f5207b7SJohn Levon 	unsigned int a = -1;
9*1f5207b7SJohn Levon 
10*1f5207b7SJohn Levon 	x = a;
11*1f5207b7SJohn Levon 	__smatch_absolute_min(a);
12*1f5207b7SJohn Levon 	__smatch_absolute_max(a);
13*1f5207b7SJohn Levon 	__smatch_absolute_min(x);
14*1f5207b7SJohn Levon 	__smatch_absolute_max(x);
15*1f5207b7SJohn Levon 	__smatch_implied(a);
16*1f5207b7SJohn Levon 	__smatch_implied(x);
17*1f5207b7SJohn Levon 	__smatch_sval_info(a);
18*1f5207b7SJohn Levon 	__smatch_sval_info(x);
19*1f5207b7SJohn Levon }
20*1f5207b7SJohn Levon /*
21*1f5207b7SJohn Levon  * check-name: smatch: absolute #2
22*1f5207b7SJohn Levon  * check-command: smatch -I.. sm_absolute2.c
23*1f5207b7SJohn Levon  *
24*1f5207b7SJohn Levon  * check-output-start
25*1f5207b7SJohn Levon sm_absolute2.c:11 func() absolute min: a = u32max
26*1f5207b7SJohn Levon sm_absolute2.c:12 func() absolute max: a = u32max
27*1f5207b7SJohn Levon sm_absolute2.c:13 func() absolute min: x = (-1)
28*1f5207b7SJohn Levon sm_absolute2.c:14 func() absolute max: x = (-1)
29*1f5207b7SJohn Levon sm_absolute2.c:15 func() implied: a = 'u32max'
30*1f5207b7SJohn Levon sm_absolute2.c:16 func() implied: x = '(-1)'
31*1f5207b7SJohn Levon sm_absolute2.c:17 func() implied: a u32 ->value = ffffffff
32*1f5207b7SJohn Levon sm_absolute2.c:18 func() implied: x s32 ->value = ffffffffffffffff
33*1f5207b7SJohn Levon  * check-output-end
34*1f5207b7SJohn Levon  */
35