aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-04-17 19:13:08 -0700
committerMichael Forney <mforney@mforney.org>2019-04-17 20:11:06 -0700
commit7569343621ce0257a239e24290557e11e31dc119 (patch)
treecef551648642c3ee7888d18440c77a752118de66 /test
parent2833c0041d669bc1ba7a6d13e7f92c23b84e04ae (diff)
Fix bit-field offsets in unions
Diffstat (limited to 'test')
-rw-r--r--test/bitfield-union.c4
-rw-r--r--test/bitfield-union.qbe1
2 files changed, 5 insertions, 0 deletions
diff --git a/test/bitfield-union.c b/test/bitfield-union.c
new file mode 100644
index 0000000..f366ec8
--- /dev/null
+++ b/test/bitfield-union.c
@@ -0,0 +1,4 @@
+union {
+ int x : 5;
+ int y : 10;
+} u = {.y = 123};
diff --git a/test/bitfield-union.qbe b/test/bitfield-union.qbe
new file mode 100644
index 0000000..95d3861
--- /dev/null
+++ b/test/bitfield-union.qbe
@@ -0,0 +1 @@
+export data $u = align 4 { b 123, z 3 }