From 7569343621ce0257a239e24290557e11e31dc119 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Wed, 17 Apr 2019 19:13:08 -0700 Subject: Fix bit-field offsets in unions --- test/bitfield-union.c | 4 ++++ test/bitfield-union.qbe | 1 + 2 files changed, 5 insertions(+) create mode 100644 test/bitfield-union.c create mode 100644 test/bitfield-union.qbe (limited to 'test') 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 } -- cgit v1.2.3