Debian Codegraph @

tools/spgen/tests/divr.expected

raw
1 /// Tests if inherited metavariables are inherited from the right rules.
2 ///
3 // Confidence: Moderate
4
5 virtual patch
6 virtual context
7 virtual org
8 virtual report
9
10 @r1@
11 identifier round_down,x,y;
12 @@
13 #define round_down(x,y) rounddown(x,y)
14
15 @r2 depends on patch && !context && !org && !report@
16 identifier round_up,x,y;
17 @@
18 -#define round_up(x,y) roundup(x,y)
19
20 @rule_0 depends on patch && !context && !org && !report@
21 identifier r1.round_down;
22 expression E1,E2;
23 @@
24 - round_down(E1, E2);
25 + roundup(E1, E2);
26
27 @rule_1 depends on patch && !context && !org && !report@
28 identifier r2.round_up;
29 expression E1,E2;
30 @@
31 - round_up(E1, E2);
32 + roundup(E1, E2);
33
34 // ----------------------------------------------------------------------------
35
36 @r2_context depends on !patch && (context || org || report)@
37 identifier round_up, x, y;
38 position j0;
39 @@
40
41 * #define round_up(x,y)@j0 roundup(x,y)
42
43 @rule_0_context depends on !patch && (context || org || report)@
44 identifier r1.round_down;
45 expression E1, E2;
46 position j0;
47 @@
48
49 * round_down@j0(E1, E2);
50
51 @rule_1_context depends on !patch && (context || org || report)@
52 identifier r2_context.round_up;
53 expression E1, E2;
54 position j0;
55 @@
56
57 * round_up@j0(E1, E2);
58
59 // ----------------------------------------------------------------------------
60
61 @script:python r2_org depends on org@
62 j0 << r2_context.j0;
63 @@
64
65 msg = "found a match around here ..."
66 coccilib.org.print_todo(j0[0], msg)
67
68 @script:python rule_0_org depends on org@
69 j0 << rule_0_context.j0;
70 @@
71
72 msg = "found a match around here ..."
73 coccilib.org.print_todo(j0[0], msg)
74
75 @script:python rule_1_org depends on org@
76 j0 << rule_1_context.j0;
77 @@
78
79 msg = "found a match around here ..."
80 coccilib.org.print_todo(j0[0], msg)
81
82 // ----------------------------------------------------------------------------
83
84 @script:python r2_report depends on report@
85 j0 << r2_context.j0;
86 @@
87
88 msg = "found a match around here ..."
89 coccilib.report.print_report(j0[0], msg)
90
91 @script:python rule_0_report depends on report@
92 j0 << rule_0_context.j0;
93 @@
94
95 msg = "found a match around here ..."
96 coccilib.report.print_report(j0[0], msg)
97
98 @script:python rule_1_report depends on report@
99 j0 << rule_1_context.j0;
100 @@
101
102 msg = "found a match around here ..."
103 coccilib.report.print_report(j0[0], msg)
104