summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2010-09-24 09:04:51 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2010-09-24 09:04:51 +0000
commitcca95c35a944a994de1daee2462c1b3663b3efd2 (patch)
treee329e63fcd9bdd182e5a8e967c8bfd8fdb9b6668 /test
parent280f002460e9b7df7f48517ada79d06252c1629c (diff)
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')
-rw-r--r--test/regression/Makefile2
-rw-r--r--test/regression/Results/bitfields71
-rw-r--r--test/regression/bitfields7.c20
3 files changed, 22 insertions, 1 deletions
diff --git a/test/regression/Makefile b/test/regression/Makefile
index 7d456df..c1925c7 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 0000000..cf2b3f3
--- /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 0000000..33e20a1
--- /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;
+}