Meta attributes are added to SmPL. Add a test case to match and remove a
meta attribute from C code.

Signed-off-by: Jaskaran Singh <jaskaran.si...@collabora.com>
---
 tests/remove_metaattr.c     | 5 +++++
 tests/remove_metaattr.cocci | 9 +++++++++
 tests/remove_metaattr.res   | 5 +++++
 3 files changed, 19 insertions(+)
 create mode 100644 tests/remove_metaattr.c
 create mode 100644 tests/remove_metaattr.cocci
 create mode 100644 tests/remove_metaattr.res

diff --git a/tests/remove_metaattr.c b/tests/remove_metaattr.c
new file mode 100644
index 000000000..d3b091cd9
--- /dev/null
+++ b/tests/remove_metaattr.c
@@ -0,0 +1,5 @@
+int main() {
+       int b __attr__ = 1;
+       int b = 1;
+       return 0;
+}
diff --git a/tests/remove_metaattr.cocci b/tests/remove_metaattr.cocci
new file mode 100644
index 000000000..e35bc7e3c
--- /dev/null
+++ b/tests/remove_metaattr.cocci
@@ -0,0 +1,9 @@
+@@
+attribute name __attr__;
+attribute a;
+identifier b;
+@@
+
+int b
+-      a
+       = 1;
diff --git a/tests/remove_metaattr.res b/tests/remove_metaattr.res
new file mode 100644
index 000000000..7d9292a55
--- /dev/null
+++ b/tests/remove_metaattr.res
@@ -0,0 +1,5 @@
+int main() {
+       int b = 1;
+       int b = 1;
+       return 0;
+}
-- 
2.21.3

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to