diff options
author | Sylvain Boulmé <sylvain.boulme@univ-grenoble-alpes.fr> | 2021-06-11 11:41:37 +0200 |
---|---|---|
committer | Sylvain Boulmé <sylvain.boulme@univ-grenoble-alpes.fr> | 2021-06-11 11:41:37 +0200 |
commit | af16cdae6d58033cc8aa06bca330f98b96ba12f2 (patch) | |
tree | 4985e9ae8fa0d580bbf95a198edeca4f0bd6ff46 /test/regression/bitfields_uint_t.c | |
parent | 21c979fce33b068ce4b86e67d3d866b203411c6c (diff) | |
parent | 02b169b444c435b8d1aacf54969dd7de57317a5c (diff) | |
download | compcert-kvx-af16cdae6d58033cc8aa06bca330f98b96ba12f2.tar.gz compcert-kvx-af16cdae6d58033cc8aa06bca330f98b96ba12f2.zip |
Merge branch 'BTL' of gricad-gitlab.univ-grenoble-alpes.fr:sixcy/CompCert into BTL
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); +} + + |