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 <[email protected]>
---
 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

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to