Meta attributes are added to SmPL. Add test case to match and detect a meta attribute in C code.
Signed-off-by: Jaskaran Singh <[email protected]> --- tests/metaattr.c | 5 +++++ tests/metaattr.cocci | 9 +++++++++ tests/metaattr.res | 5 +++++ 3 files changed, 19 insertions(+) create mode 100644 tests/metaattr.c create mode 100644 tests/metaattr.cocci create mode 100644 tests/metaattr.res diff --git a/tests/metaattr.c b/tests/metaattr.c new file mode 100644 index 000000000..d3b091cd9 --- /dev/null +++ b/tests/metaattr.c @@ -0,0 +1,5 @@ +int main() { + int b __attr__ = 1; + int b = 1; + return 0; +} diff --git a/tests/metaattr.cocci b/tests/metaattr.cocci new file mode 100644 index 000000000..a325ad06f --- /dev/null +++ b/tests/metaattr.cocci @@ -0,0 +1,9 @@ +@@ +attribute name __attr__; +attribute a; +identifier b; +@@ + +- int ++ char + b a = 1; diff --git a/tests/metaattr.res b/tests/metaattr.res new file mode 100644 index 000000000..9cd2014f2 --- /dev/null +++ b/tests/metaattr.res @@ -0,0 +1,5 @@ +int main() { + char b __attr__ = 1; + int b = 1; + return 0; +} -- 2.21.3 _______________________________________________ Cocci mailing list [email protected] https://systeme.lip6.fr/mailman/listinfo/cocci
