aboutsummaryrefslogtreecommitdiff
path: root/test/bitfield-short.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-07-05 22:26:52 -0700
committerMichael Forney <mforney@mforney.org>2021-07-05 22:26:57 -0700
commit7bf0c0fb11af04d50cf7c374a44aa6101cca9c9d (patch)
tree4a54ad7462e00b49e2e7b981daedcd94f408ed5a /test/bitfield-short.c
parent003f6a14b05bb16fa6f950dc193a8cbd62e0836d (diff)
qbe: Fix bitfield sign extension with types shorter than int
Diffstat (limited to 'test/bitfield-short.c')
-rw-r--r--test/bitfield-short.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/bitfield-short.c b/test/bitfield-short.c
new file mode 100644
index 0000000..b0be6fd
--- /dev/null
+++ b/test/bitfield-short.c
@@ -0,0 +1,7 @@
+struct {
+ short x : 7;
+} s = {.x = -64};
+
+int main(void) {
+ return s.x > 0;
+}