aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/linear/bitfield-expand-deref.c
diff options
Diffstat (limited to 'validation/linear/bitfield-expand-deref.c')
-rw-r--r--validation/linear/bitfield-expand-deref.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/validation/linear/bitfield-expand-deref.c b/validation/linear/bitfield-expand-deref.c
new file mode 100644
index 00000000..0a958633
--- /dev/null
+++ b/validation/linear/bitfield-expand-deref.c
@@ -0,0 +1,28 @@
+struct s {
+ int a:8;
+ int b:8;
+};
+
+int foo(void)
+{
+ struct s x = { .a = 12, .b = 34, };
+
+ return x.b;
+}
+
+int bar(int a)
+{
+ struct s x = { .a = 12, .b = a, };
+
+ return x.b;
+}
+
+/*
+ * check-name: bitfield expand deref
+ * check-command: test-linearize -Wno-decl $file
+ * check-known-to-fail
+ *
+ * check-output-ignore
+ * check-output-excludes: ret\..*\$12
+ * check-output-contains: ret\..*\$34
+ */