All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: linux-sparse@vger.kernel.org
Cc: Christopher Li <sparse@chrisli.org>,
	Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH] add test case for builtin bswap with constant args
Date: Wed, 23 Nov 2016 21:38:55 +0100	[thread overview]
Message-ID: <20161123203855.14957-1-luc.vanoostenryck@gmail.com> (raw)
In-Reply-To: <CANeU7QkABOFTdUCdabWL1YwHb3Qf4huVL115AHqZBNcqUytmhg@mail.gmail.com>

---
 validation/builtin-constant-eval.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 validation/builtin-constant-eval.c

diff --git a/validation/builtin-constant-eval.c b/validation/builtin-constant-eval.c
new file mode 100644
index 00000000..63e586e9
--- /dev/null
+++ b/validation/builtin-constant-eval.c
@@ -0,0 +1,28 @@
+unsigned short bswap16(void);
+unsigned short bswap16(void)
+{
+	return __builtin_bswap16(0x1234);
+}
+
+unsigned int bswap32(void);
+unsigned int bswap32(void)
+{
+	return __builtin_bswap32(0x12345678);
+}
+
+unsigned long long bswap64(void);
+unsigned long long bswap64(void)
+{
+	return __builtin_bswap64(0x123456789abcdef0ULL);
+}
+
+/*
+ * check-name: builtin-eval
+ * check-command: test-linearize $file
+ *
+ * check-output-ignore
+ * check-output-excludes: __builtin_bswap
+ * check-output-contains:ret.16 *.0x3412
+ * check-output-contains:ret.32 *.0x78563412
+ * check-output-contains:ret.64 *.0xf0debc9a78563412
+ */
-- 
2.10.2


  reply	other threads:[~2016-11-23 20:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-17  9:55 [PATCH v2] implement constant-folding in __builtin_bswap*() Johannes Berg
2016-11-21  2:38 ` Christopher Li
2016-11-21  9:45   ` Johannes Berg
2016-11-22 11:13     ` Christopher Li
2016-11-22 11:39       ` Christopher Li
2016-11-22 13:15       ` Luc Van Oostenryck
2016-11-22 16:32         ` Christopher Li
2016-11-22 17:12           ` Luc Van Oostenryck
2016-11-23  1:23             ` Christopher Li
2016-11-22 20:16           ` Luc Van Oostenryck
2016-11-23  1:25             ` Christopher Li
2016-11-23 20:38               ` Luc Van Oostenryck [this message]
2016-11-24  0:17                 ` [PATCH] add test case for builtin bswap with constant args Christopher Li
2016-11-24  5:30                 ` Christopher Li
2016-11-24 13:00                   ` Luc Van Oostenryck
2016-11-23 20:48               ` [PATCH v2] implement constant-folding in __builtin_bswap*() Luc Van Oostenryck
2016-11-24  0:56                 ` Christopher Li
2016-11-24  0:58                   ` Christopher Li
2016-11-24  1:36                     ` Luc Van Oostenryck
2016-11-24  3:17                       ` Christopher Li
2016-11-24  1:31                   ` Luc Van Oostenryck
2016-11-24  3:23                     ` Christopher Li
2016-11-23  6:28           ` Johannes Berg
2016-11-23 14:30             ` Christopher Li

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=20161123203855.14957-1-luc.vanoostenryck@gmail.com \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sparse@chrisli.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.