aboutsummaryrefslogtreecommitdiff
path: root/test/bitfield-integer-promotion-long.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-04-23 21:22:25 -0700
committerMichael Forney <mforney@mforney.org>2019-04-23 21:23:19 -0700
commita98385a607aafe373c14d2a6fb2778d21a600c30 (patch)
tree2b4c71cfb8f7ceab26e65f4489905a85488f6791 /test/bitfield-integer-promotion-long.c
parente0b772b836265b77686e9a7aa8ad01bb1fca53e7 (diff)
Fix integer promotion on bit-fields
Fixes #47.
Diffstat (limited to 'test/bitfield-integer-promotion-long.c')
-rw-r--r--test/bitfield-integer-promotion-long.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/bitfield-integer-promotion-long.c b/test/bitfield-integer-promotion-long.c
new file mode 100644
index 0000000..fc51fbc
--- /dev/null
+++ b/test/bitfield-integer-promotion-long.c
@@ -0,0 +1,6 @@
+struct {unsigned long x:31;} s1;
+struct {unsigned long x:32;} s2;
+struct {unsigned long x:33;} s3;
+int c1 = __builtin_types_compatible_p(__typeof__(+s1.x), int);
+int c2 = __builtin_types_compatible_p(__typeof__(+s2.x), unsigned);
+int c3 = __builtin_types_compatible_p(__typeof__(+s3.x), unsigned long);