1void _spin_lock(int name);
2void _spin_unlock(int name);
3
4void frob(void){}
5int a;
6int b;
7int c;
8int func (void)
9{
10	int mylock = 1;
11	int mylock2 = 2;
12
13	if (a == 3)
14	      	_spin_lock(mylock);
15	if (b)
16		frob();
17	if (a == 3)
18	      	_spin_unlock(mylock);
19	if (a)
20	      	_spin_lock(mylock);
21	if (c)
22		return 0;
23	if (!!a)
24	      	_spin_unlock(mylock);
25	return 0;
26}
27
28/*
29 * check-name: Smatch implied #4
30 * check-command: smatch --project=kernel --spammy sm_implied4.c
31 *
32 * check-output-start
33sm_implied4.c:22 func() warn: 'spin_lock:mylock' is sometimes locked here and sometimes unlocked.
34 * check-output-end
35 */
36