aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2018-04-21 18:57:51 +0300
committerXavier Leroy <xavierleroy@users.noreply.github.com>2018-04-25 14:27:31 +0200
commit92c8be3a36dff49f92e6cf94719a1750e4961538 (patch)
tree535a8dd1af2fad409abb00a6a356e3d5f0c02cef /test
parent7be3e73fa8a46b6b813c1be98da54a1a471378b9 (diff)
downloadcompcert-92c8be3a36dff49f92e6cf94719a1750e4961538.tar.gz
compcert-92c8be3a36dff49f92e6cf94719a1750e4961538.zip
Initialization of anonymous bit-fields in structs
For anonymous bit-fields in structs, carrier fields may be introduced which are not initialized since no default initializer are generated earlier. This cause the translation in C2C to throw an error since too few initializers are available. Example: struct s2 { int : 10; int a; int : 10; char b; int : 10; short c; int : 10; } s2 = { 42, 'a', 43 }; To work around this issue we need to generate a default inializer for every new member that does not have a translated member. Based on P#80, with more efficient algorithms. Bug 23362
Diffstat (limited to 'test')
-rw-r--r--test/regression/bitfields9.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/regression/bitfields9.c b/test/regression/bitfields9.c
index 54cc34ab..eef20168 100644
--- a/test/regression/bitfields9.c
+++ b/test/regression/bitfields9.c
@@ -11,6 +11,7 @@ struct t {
unsigned int c: 16;
_Bool d: 1;
short e: 8;
+ int : 10;
};
union u {