linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH 1/5] pre-process: add testcases for __has_feature() & __has_extension()
Date: Thu, 18 Jun 2020 22:47:12 +0200	[thread overview]
Message-ID: <20200618204716.3896-2-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <20200618204716.3896-1-luc.vanoostenryck@gmail.com>

The support for these builtin macros is incoming.
So, add some testcases for them.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 validation/preprocessor/has-feature.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 validation/preprocessor/has-feature.c

diff --git a/validation/preprocessor/has-feature.c b/validation/preprocessor/has-feature.c
new file mode 100644
index 000000000000..3ab7c3e039fa
--- /dev/null
+++ b/validation/preprocessor/has-feature.c
@@ -0,0 +1,21 @@
+#ifndef __has_feature
+__has_feature()??? Quesako?
+#define __has_feature(x) 0
+#else
+"has __has_feature(), yeah!"
+#endif
+
+#if __has_feature(not_a_feature)
+#error "not a feature!"
+#endif
+
+/*
+ * check-name: has-feature
+ * check-command: sparse -E $file
+ * check-known-to-fail
+ *
+ * check-output-start
+
+"has __has_feature(), yeah!"
+ * check-output-end
+ */
-- 
2.27.0

  reply	other threads:[~2020-06-18 20:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18 20:47 [PATCH 0/5] support builtin macros & __has_feature() Luc Van Oostenryck
2020-06-18 20:47 ` Luc Van Oostenryck [this message]
2020-06-18 20:47 ` [PATCH 2/5] pre-process: rename 'expander' into 'expand_simple' Luc Van Oostenryck
2020-06-18 20:47 ` [PATCH 3/5] pre-process: add support for builtin macros Luc Van Oostenryck
2020-06-18 20:47 ` [PATCH 4/5] pre-process: add support for __has_feature() & __has_extension() Luc Van Oostenryck
2020-06-18 20:47 ` [PATCH 5/5] pre-process: make __has_{attribute,builtin}() true builtin macros Luc Van Oostenryck

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=20200618204716.3896-2-luc.vanoostenryck@gmail.com \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@vger.kernel.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).