[PATCH 04/17] add testcase for addressability of 'complex' symbols

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

 



Once a symbol has its address taken, a lot of simplifications
must be avoided because the symbol can now be modified via
a pointer.

This is currently done but the symbol addressability
does not take in account the fact that a symbol can be
accessed via one of its subfields.

Add a testcase to illustrate this.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 validation/eval/addressable-complex.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 validation/eval/addressable-complex.c

diff --git a/validation/eval/addressable-complex.c b/validation/eval/addressable-complex.c
new file mode 100644
index 000000000000..62ab59f04cf9
--- /dev/null
+++ b/validation/eval/addressable-complex.c
@@ -0,0 +1,24 @@
+extern void def(void *);
+
+struct s1 {
+	int a;
+};
+
+int use1(void)
+{
+	struct s1 s = { 3 };
+
+	def(&s.a);
+
+	return s.a;
+}
+
+/*
+ * check-name: eval/addressable-complex
+ * check-command: test-linearize -Wno-decl -fdump-ir $file
+ * check-known-to-fail
+ *
+ * check-output-ignore
+ * check-output-contains: load\\.
+ * check-output-excludes: return\\..*\\$3
+ */
-- 
2.24.0




[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