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 | |
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')
-rw-r--r-- | test/regression/Makefile | 2 | ||||
-rw-r--r-- | test/regression/Results/bitfields7 | 1 | ||||
-rw-r--r-- | test/regression/bitfields7.c | 20 |
3 files changed, 22 insertions, 1 deletions
diff --git a/test/regression/Makefile b/test/regression/Makefile index 7d456df5..c1925c79 100644 --- a/test/regression/Makefile +++ b/test/regression/Makefile @@ -9,7 +9,7 @@ LIBS=$(LIBMATH) # Can run and have reference output in Results TESTS=bitfields1 bitfields2 bitfields3 bitfields4 \ - bitfields5 bitfields6 \ + bitfields5 bitfields6 bitfields7 \ expr1 initializers volatile2 \ funct3 expr5 struct7 struct8 casts1 casts2 diff --git a/test/regression/Results/bitfields7 b/test/regression/Results/bitfields7 new file mode 100644 index 00000000..cf2b3f34 --- /dev/null +++ b/test/regression/Results/bitfields7 @@ -0,0 +1 @@ +g_22.f2 = 1 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; +} |