This would previously yield pretty printing errors,
i.e. bool would be printed on the next line, followed by ret on
the next to next line.
The metatype should be only bool and not bool.
Signed-off-by: Jaskaran Singh
---
tests/macro_before_bool.c | 4
tests/macro_before_bool.cocci | 9 +
tests/macro_before_bool.res | 5 +
3 files changed, 18 insertions(+)
create mode 100644 tests/macro_before_bool.c
create mode 100644 tests/macro_before_bool.cocci
create mode 100644 tests/macro_before_bool.res
diff --git a/tests/macro_before_bool.c b/tests/macro_before_bool.c
new file mode 100644
index ..a59cba5a
--- /dev/null
+++ b/tests/macro_before_bool.c
@@ -0,0 +1,4 @@
+static nokprobe_inline bool trace_kprobe_is_return(struct trace_kprobe *tk)
+{
+ return false;
+}
diff --git a/tests/macro_before_bool.cocci b/tests/macro_before_bool.cocci
new file mode 100644
index ..53b2fd2e
--- /dev/null
+++ b/tests/macro_before_bool.cocci
@@ -0,0 +1,9 @@
+@@
+type t;
+identifier x;
+@@
+
+t x(...) {
++ t ret;
+ return false;
+}
diff --git a/tests/macro_before_bool.res b/tests/macro_before_bool.res
new file mode 100644
index ..1b0ec319
--- /dev/null
+++ b/tests/macro_before_bool.res
@@ -0,0 +1,5 @@
+static nokprobe_inline bool trace_kprobe_is_return(struct trace_kprobe *tk)
+{
+ bool ret;
+ return false;
+}
--
2.21.1
___
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci