[Linux-kernel-mentees] [PATCH 25/27] tests: Add test case to remove a struct end attribute

Jaskaran Singh jaskaransingh7654321 at gmail.com
Sun May 31 15:26:19 UTC 2020


Stuct end attributes are added to the SmPL and C ASTs. Add a test case
to remove struct end attributes.

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

diff --git a/tests/remove_struct_endattr.c b/tests/remove_struct_endattr.c
new file mode 100644
index 00000000..95aa8610
--- /dev/null
+++ b/tests/remove_struct_endattr.c
@@ -0,0 +1,7 @@
+#define __struct_endattr MACROANNOTATION
+
+struct abcd {
+	int a;
+	int b;
+	int c;
+} __struct_endattr;
diff --git a/tests/remove_struct_endattr.cocci b/tests/remove_struct_endattr.cocci
new file mode 100644
index 00000000..c4b86864
--- /dev/null
+++ b/tests/remove_struct_endattr.cocci
@@ -0,0 +1,7 @@
+@@
+attribute name __struct_endattr;
+@@
+
+struct abcd {...}
+-	__struct_endattr
+;
diff --git a/tests/remove_struct_endattr.res b/tests/remove_struct_endattr.res
new file mode 100644
index 00000000..dda83724
--- /dev/null
+++ b/tests/remove_struct_endattr.res
@@ -0,0 +1,7 @@
+#define __struct_endattr MACROANNOTATION
+
+struct abcd {
+	int a;
+	int b;
+	int c;
+};
-- 
2.21.1



More information about the Linux-kernel-mentees mailing list