aboutsummaryrefslogtreecommitdiffstats
path: root/test/regression/bitfields9.c
Commit message (Collapse)AuthorAgeFilesLines
* Initialization of anonymous bit-fields in structsXavier Leroy2018-04-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Initialization of union bit fieldsXavier Leroy2018-04-251-0/+25
| | | | | | | | | | | Bit fields in unions were initialized like normal fields, causing mismatch on the name of the field. Also: added function Bitfields.carrier_field and refactored. Patch by Bernhard Schommer. Bug 23362
* Fix issue with bit fields of type _BoolXavier Leroy2015-07-081-7/+7
| | | | | | cparser/Bitfields.ml: when assigning to a bit field of type _Bool, the right-hand side must be normalized to 0 or 1 via a cast to _Bool. test/regression/bitfields{1,9}.c: add corresponding test cases.
* Extended inline asm: handle missing cases.Xavier Leroy2015-04-281-0/+49
Bitfields: better translation of initializers and compound literals; run this pass before unblocking. Transform.stmt: extend with ability to treat unblocked code. test/regression: more bitfield tests.