aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/linear/compound-literal02.c
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-03-07 14:00:15 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-07-01 00:18:44 +0200
commit745c0d82a5099f6c2680bc1459a652f354a75d10 (patch)
treea6aee4ced9e5d7f8b1f8bc54fcdf2cc9c6ff9a5b /validation/linear/compound-literal02.c
parent13cf4aaeef36031fcee071a1efcf9092b7d7cdf7 (diff)
downloadsparse-dev-745c0d82a5099f6c2680bc1459a652f354a75d10.tar.gz
testsuite: reorganize tests for compound literals
Split the existing test in 2 as it contains 2 different cases. Also move the test to 'linear/' subdir. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/linear/compound-literal02.c')
-rw-r--r--validation/linear/compound-literal02.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/validation/linear/compound-literal02.c b/validation/linear/compound-literal02.c
new file mode 100644
index 00000000..87b98d76
--- /dev/null
+++ b/validation/linear/compound-literal02.c
@@ -0,0 +1,19 @@
+struct bfs {
+ int a: 2;
+ int b: 30;
+};
+
+int bar(void)
+{
+ struct bfs bf = { .a = 1, .b = 4 };
+ return (struct bfs[]){bf, { .a = 3, .b = 6}}[1].b;
+}
+
+/*
+ * check-name: compound-literal02.c
+ * check-command: test-linearize -Wno-decl $file
+ *
+ * check-known-to-fail
+ * check-output-ignore
+ * check-output-contains: ret\\..*\\$6
+ */