[Linux-kernel-mentees] [PATCH 29/30] tests: Add test case to remove macrodecl attributes

Jaskaran Singh jaskaransingh7654321 at gmail.com
Sun May 24 17:19:34 UTC 2020


Macrodecl attributes are added to the SmPL and C ASTs. Add a test case
to remove a macrodecl attribute.

Signed-off-by: Jaskaran Singh <jaskaransingh7654321 at gmail.com>
---
 tests/remove_macrodecl_attr.c     | 3 +++
 tests/remove_macrodecl_attr.cocci | 8 ++++++++
 tests/remove_macrodecl_attr.res   | 3 +++
 3 files changed, 14 insertions(+)
 create mode 100644 tests/remove_macrodecl_attr.c
 create mode 100644 tests/remove_macrodecl_attr.cocci
 create mode 100644 tests/remove_macrodecl_attr.res

diff --git a/tests/remove_macrodecl_attr.c b/tests/remove_macrodecl_attr.c
new file mode 100644
index 00000000..73ed6d63
--- /dev/null
+++ b/tests/remove_macrodecl_attr.c
@@ -0,0 +1,3 @@
+#define __macro_attr MACROANNOTATION
+
+DECLARER(a, b) __macro_attr;
diff --git a/tests/remove_macrodecl_attr.cocci b/tests/remove_macrodecl_attr.cocci
new file mode 100644
index 00000000..cd0c44bc
--- /dev/null
+++ b/tests/remove_macrodecl_attr.cocci
@@ -0,0 +1,8 @@
+ at r0@
+declarer name DECLARER;
+attribute name __macro_attr;
+@@
+
+DECLARER(...)
+- __macro_attr
+;
diff --git a/tests/remove_macrodecl_attr.res b/tests/remove_macrodecl_attr.res
new file mode 100644
index 00000000..38e4add5
--- /dev/null
+++ b/tests/remove_macrodecl_attr.res
@@ -0,0 +1,3 @@
+#define __macro_attr MACROANNOTATION
+
+DECLARER(a, b);
-- 
2.21.1



More information about the Linux-kernel-mentees mailing list