diff options
author | Yann Herklotz <git@yannherklotz.com> | 2021-09-17 18:28:55 +0100 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2021-09-17 18:28:55 +0100 |
commit | a1c401a4eba5fc9fcf42933f70005ecb679a4c1c (patch) | |
tree | 26637fca5d1da9b3d049234721d593a60b03a6d3 /test/regression/bitfields_uint_t.c | |
parent | c49caca4b5f0239b43610fbfe012d6ba0211b364 (diff) | |
parent | 1daf96cdca4d828c333cea5c9a314ef861342984 (diff) | |
download | compcert-a1c401a4eba5fc9fcf42933f70005ecb679a4c1c.tar.gz compcert-a1c401a4eba5fc9fcf42933f70005ecb679a4c1c.zip |
Merge branch 'master' into dev/michalisdev/michalis
Diffstat (limited to 'test/regression/bitfields_uint_t.c')
-rw-r--r-- | test/regression/bitfields_uint_t.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/regression/bitfields_uint_t.c b/test/regression/bitfields_uint_t.c new file mode 100644 index 00000000..3d7fb4e7 --- /dev/null +++ b/test/regression/bitfields_uint_t.c @@ -0,0 +1,22 @@ +#include <stdio.h> +#include <stdint.h> + +/* Test that uint32 type synonym works. + This previously failed for standard headers where uint32 is defined + as a (32-bit) unsigned long. */ + +struct s { + uint32_t a: 1; + uint32_t b: 2; + uint32_t c: 9; + uint32_t d: 20; +}; + +struct s x = { 1, 2, 3, 4 }; + +int main() +{ + printf("x = { a = %d, b = %d, c = %d, d = %d }\n", x.a, x.b, x.c, x.d); +} + + |