Coccinelle release 1.0.0-rc1
[bpt/coccinelle.git] / tests / spl.cocci
CommitLineData
34e49164
C
1// this illustrates how when strict is not so effective. if the comment is
2// removed, only the first return gets its spin_unlock, because the pattern
3// is not found under the then of the first if in the C code. it is not
4// good enough that there is a matching pattern around the then
5
6@@
7expression l;
8@@
9
10spin_lock(l);
11... when any
12// when strict
13if (...) {
14+ spin_unlock(l);
15 return ...;
16}