From a98385a607aafe373c14d2a6fb2778d21a600c30 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 23 Apr 2019 21:22:25 -0700 Subject: Fix integer promotion on bit-fields Fixes #47. --- test/bitfield-integer-promotion-long.c | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 test/bitfield-integer-promotion-long.c (limited to 'test/bitfield-integer-promotion-long.c') 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); -- cgit v1.2.3