1*1f5207b7SJohn Levon #include <stdio.h>
2*1f5207b7SJohn Levon #include <string.h>
3*1f5207b7SJohn Levon #include "check_debug.h"
4*1f5207b7SJohn Levon 
cmp_x(int x,int y)5*1f5207b7SJohn Levon int cmp_x(int x, int y)
6*1f5207b7SJohn Levon {
7*1f5207b7SJohn Levon 	if (x < y) {
8*1f5207b7SJohn Levon 		__smatch_compare(x, y);
9*1f5207b7SJohn Levon 		return -1;
10*1f5207b7SJohn Levon 	}
11*1f5207b7SJohn Levon 	if (x == y) {
12*1f5207b7SJohn Levon 		__smatch_compare(x, y);
13*1f5207b7SJohn Levon 		return 0;
14*1f5207b7SJohn Levon 	}
15*1f5207b7SJohn Levon 	__smatch_compare(x, y);
16*1f5207b7SJohn Levon 	return 1;
17*1f5207b7SJohn Levon }
18*1f5207b7SJohn Levon 
19*1f5207b7SJohn Levon /*
20*1f5207b7SJohn Levon  * check-name: smatch compare #13
21*1f5207b7SJohn Levon  * check-command: smatch -I.. sm_compare13.c
22*1f5207b7SJohn Levon  *
23*1f5207b7SJohn Levon  * check-output-start
24*1f5207b7SJohn Levon sm_compare13.c:8 cmp_x() x < y
25*1f5207b7SJohn Levon sm_compare13.c:12 cmp_x() x == y
26*1f5207b7SJohn Levon sm_compare13.c:15 cmp_x() x > y
27*1f5207b7SJohn Levon  * check-output-end
28*1f5207b7SJohn Levon  */
29