-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sys/test: add more tests for bitfields
Add tests for issue #1542 The correct results are obtained with the following program: struct foo { unsigned char f0; unsigned int f1:4; unsigned short f2:4; }; struct bar { char f0; struct foo foo; }; int main() { struct bar y; memset(&y, 0, sizeof(y)); y.f0 = 0x12; y.foo.f0 = 0x34; y.foo.f1 = 0x56; y.foo.f2 = 0x78; int i; for (i = 0; i < sizeof(y); i++) printf("%02x", ((unsigned char*)&y)[i]); printf("\n"); }
- Loading branch information
Showing
7 changed files
with
359 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.