From: Jaskaran Singh <jaskaransingh7654321@gmail.com>
To: cocci@systeme.lip6.fr
Cc: linux-kernel-mentees@lists.linuxfoundation.org
Subject: [Cocci] [PATCH 2/2] tests: Add test case for * const *
Date: Thu, 16 Jan 2020 16:14:48 +0530 [thread overview]
Message-ID: <20200116104448.15539-3-jaskaransingh7654321@gmail.com> (raw)
In-Reply-To: <20200116104448.15539-1-jaskaransingh7654321@gmail.com>
Previously, a space would not be added after the * const. Add
a test case for testing spacing with use of the type.
Signed-off-by: Jaskaran Singh <jaskaransingh7654321@gmail.com>
---
tests/ptrconstptr.c | 3 +++
tests/ptrconstptr.cocci | 7 +++++++
tests/ptrconstptr.res | 3 +++
3 files changed, 13 insertions(+)
create mode 100644 tests/ptrconstptr.c
create mode 100644 tests/ptrconstptr.cocci
create mode 100644 tests/ptrconstptr.res
diff --git a/tests/ptrconstptr.c b/tests/ptrconstptr.c
new file mode 100644
index 00000000..a2a3cf71
--- /dev/null
+++ b/tests/ptrconstptr.c
@@ -0,0 +1,3 @@
+void main() {
+ const char * const * x;
+}
diff --git a/tests/ptrconstptr.cocci b/tests/ptrconstptr.cocci
new file mode 100644
index 00000000..030bc024
--- /dev/null
+++ b/tests/ptrconstptr.cocci
@@ -0,0 +1,7 @@
+@@
+type t;
+@@
+void main() {
+- t x;
++ t y;
+}
diff --git a/tests/ptrconstptr.res b/tests/ptrconstptr.res
new file mode 100644
index 00000000..f5b2210c
--- /dev/null
+++ b/tests/ptrconstptr.res
@@ -0,0 +1,3 @@
+void main() {
+ const char *const *y;
+}
--
2.21.1
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci
next prev parent reply other threads:[~2020-01-16 10:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-16 5:18 [Cocci] [PATCH] parsing_c: Add space for tokens after * Jaskaran Singh
2020-01-16 9:09 ` Julia Lawall
2020-01-16 10:44 ` [Cocci] [PATCH 0/2] cocci: " Jaskaran Singh
2020-01-16 10:44 ` [Cocci] [PATCH 1/2] parsing_c: " Jaskaran Singh
2020-01-16 10:44 ` Jaskaran Singh [this message]
2020-01-16 15:36 ` [Cocci] [PATCH 2/2] tests: Add test case for * const * Julia Lawall
2020-01-16 13:42 Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200116104448.15539-3-jaskaransingh7654321@gmail.com \
--to=jaskaransingh7654321@gmail.com \
--cc=cocci@systeme.lip6.fr \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).