[PATCH 1/2] expand: add test for expansion of compound literals

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

 



Compound literals are currently not expanded.
Add a test for this.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 validation/expand/compound-literal.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 validation/expand/compound-literal.c

diff --git a/validation/expand/compound-literal.c b/validation/expand/compound-literal.c
new file mode 100644
index 000000000..7401b0191
--- /dev/null
+++ b/validation/expand/compound-literal.c
@@ -0,0 +1,27 @@
+#define SAME_TYPE(A, B)	\
+	__builtin_types_compatible_p(A, B)
+
+struct s {
+	int i;
+};
+
+static void foo(struct s *p)
+{
+	*p = (struct s) { .i = SAME_TYPE(int, int), };
+}
+
+/*
+ * check-name: compound-literal
+ * check-command: test-linearize $file
+ * check-known-to-fail
+ *
+ * check-output-start
+foo:
+.L0:
+	<entry-point>
+	store.32    $1 -> 0[%arg1]
+	ret
+
+
+ * check-output-end
+ */
-- 
2.20.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