diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2010-09-24 09:04:51 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2010-09-24 09:04:51 +0000 |
commit | cca95c35a944a994de1daee2462c1b3663b3efd2 (patch) | |
tree | e329e63fcd9bdd182e5a8e967c8bfd8fdb9b6668 /test/regression/bitfields7.c | |
parent | 280f002460e9b7df7f48517ada79d06252c1629c (diff) | |
download | compcert-cca95c35a944a994de1daee2462c1b3663b3efd2.tar.gz compcert-cca95c35a944a994de1daee2462c1b3663b3efd2.zip |
Inconsistent treatment of "lone" zero-width bit fields
(i.e. not preceded by another bit field).
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1516 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test/regression/bitfields7.c')
-rw-r--r-- | test/regression/bitfields7.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/regression/bitfields7.c b/test/regression/bitfields7.c new file mode 100644 index 00000000..33e20a12 --- /dev/null +++ b/test/regression/bitfields7.c @@ -0,0 +1,20 @@ +#include <stdio.h> + +struct S0 { + signed f0 : 12; + unsigned f1 : 28; +}; + +struct S5 { + struct S0 f1; + unsigned : 0; + signed f2 : 26; +}; + +struct S5 g_22 = {{0,0},1}; + +int main(int argc, char* argv[]) +{ + printf("g_22.f2 = %d\n", g_22.f2); + return 0; +} |