| 1 |
/// This tests that position variables in #defines are put in the right places. |
| 2 |
/// |
| 3 |
// Confidence: Moderate |
| 4 |
|
| 5 |
virtual patch |
| 6 |
virtual context |
| 7 |
virtual org |
| 8 |
virtual report |
| 9 |
|
| 10 |
@r1 depends on patch && !context && !org && !report@ |
| 11 |
identifier round_up,x,y; |
| 12 |
@@ |
| 13 |
-#define round_up(x,y) roundup(x,y) |
| 14 |
|
| 15 |
@r2 depends on patch && !context && !org && !report@ |
| 16 |
identifier name; |
| 17 |
@@ |
| 18 |
-#define name 4 |
| 19 |
|
| 20 |
// ---------------------------------------------------------------------------- |
| 21 |
|
| 22 |
@r1_context depends on !patch && (context || org || report)@ |
| 23 |
identifier round_up, x, y; |
| 24 |
position j0; |
| 25 |
@@ |
| 26 |
|
| 27 |
* #define round_up(x,y)@j0 roundup(x,y) |
| 28 |
|
| 29 |
@r2_context depends on !patch && (context || org || report)@ |
| 30 |
identifier name; |
| 31 |
position j0; |
| 32 |
@@ |
| 33 |
|
| 34 |
* #define name@j0 4 |
| 35 |
|
| 36 |
// ---------------------------------------------------------------------------- |
| 37 |
|
| 38 |
@script:python r1_org depends on org@ |
| 39 |
j0 << r1_context.j0; |
| 40 |
@@ |
| 41 |
|
| 42 |
msg = "found a match around here ..." |
| 43 |
coccilib.org.print_todo(j0[0], msg) |
| 44 |
|
| 45 |
@script:python r2_org depends on org@ |
| 46 |
j0 << r2_context.j0; |
| 47 |
@@ |
| 48 |
|
| 49 |
msg = "found a match around here ..." |
| 50 |
coccilib.org.print_todo(j0[0], msg) |
| 51 |
|
| 52 |
// ---------------------------------------------------------------------------- |
| 53 |
|
| 54 |
@script:python r1_report depends on report@ |
| 55 |
j0 << r1_context.j0; |
| 56 |
@@ |
| 57 |
|
| 58 |
msg = "found a match around here ..." |
| 59 |
coccilib.report.print_report(j0[0], msg) |
| 60 |
|
| 61 |
@script:python r2_report depends on report@ |
| 62 |
j0 << r2_context.j0; |
| 63 |
@@ |
| 64 |
|
| 65 |
msg = "found a match around here ..." |
| 66 |
coccilib.report.print_report(j0[0], msg) |
| 67 |
|