[PATCH 4/4] sparse, llvm: add a struct access test case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Cc: Pekka Enberg <penberg@xxxxxxxxxx>
Cc: Christopher Li <sparse@xxxxxxxxxxx>
Cc: Jeff Garzik <jgarzik@xxxxxxxxxx>
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Cc: Xi Wang <xi.wang@xxxxxxxxx>
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@xxxxxxx>
---
 validation/backend/struct-access.c |   28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 validation/backend/struct-access.c

diff --git a/validation/backend/struct-access.c b/validation/backend/struct-access.c
new file mode 100644
index 0000000..884b470
--- /dev/null
+++ b/validation/backend/struct-access.c
@@ -0,0 +1,28 @@
+struct st {
+	int i, *d;
+};
+
+static int load_i(struct st *st)
+{
+	return st->i;
+}
+
+static void store_i(struct st *st, int i)
+{
+	st->i = i;
+}
+
+static int *load_d(struct st *st)
+{
+	return st->d;
+}
+
+static void store_d(struct st *st, int *d)
+{
+	st->d = d;
+}
+
+/*
+ * check-name: struct access code generation
+ * check-command: ./sparsec -c $file -o tmp.o
+ */
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux