[PATCH 1/2] add test case unexamined base type

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

 



Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 validation/bugs/unexamined-base-type-00.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 validation/bugs/unexamined-base-type-00.c

diff --git a/validation/bugs/unexamined-base-type-00.c b/validation/bugs/unexamined-base-type-00.c
new file mode 100644
index 000000000..2032599b7
--- /dev/null
+++ b/validation/bugs/unexamined-base-type-00.c
@@ -0,0 +1,29 @@
+# define __force	__attribute__((force))
+
+
+struct s {
+	int a;
+};
+
+static int foo(struct s *s)
+{
+	return (*((typeof(s->a) __force *) &s->a)) & 1;
+}
+
+
+/*
+ * check-name: unexamined base type 00
+ * check-command: test-linearize -Wno-decl $file
+ * check-description:
+ *	The wrong generated is:
+ *		ptrcast.64  %r3 <- (64) %arg1
+ *		load        %r4 <- 0[%r3]	; !! WRONG
+ *		cast.32     %r5 <- (0) %r4	; !! WRONG
+ *		and.32      %r6 <- %r5, $1
+ *		ret.32      %r6
+ * check-known-to-fail
+ *
+ * check-output-ignore
+ * check-output-excludes: load[^.]
+ * check-output-excludes: cast\..*(0)
+ */
-- 
2.15.0

--
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