Coccinelle release 0.2.5-rc3
[bpt/coccinelle.git] / tests / ppos.cocci
1 @a@
2 position p;
3 identifier f;
4 expression E;
5 @@
6
7 f(...) {
8 <... when strict
9 (
10 E@p = ERR_PTR(...)
11 |
12 E@p = NULL
13 )
14 ...>
15 return E;
16 }
17
18 @b exists@
19 identifier f, fld;
20 expression E,E1,E2;
21 position p1, p2 != a.p;
22 @@
23
24 f(...) {
25 (
26 ... when any
27 E@p2 = E1
28 ... when != E->fld
29 when != E = E2
30 return@p1 E;
31 |
32 ... when != E->fld
33 when != E = E2
34 return@p1 E;
35 )
36 }