diff options
| author | 2025-09-14 23:33:45 +0200 | |
|---|---|---|
| committer | 2025-09-14 23:33:45 +0200 | |
| commit | 3386b092d8e8b00191ef511ea585fe875578efe7 (patch) | |
| tree | 974b76056954dd94508a1769778ca1b0587cbacd /test | |
| parent | f4e3e27dd0b56ac39f0f6242d3464df764ab2a61 (diff) | |
start implementing bitfields
Diffstat (limited to 'test')
| -rw-r--r-- | test/test4.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/test4.c b/test/test4.c index 4a127d0..12d9ca4 100644 --- a/test/test4.c +++ b/test/test4.c @@ -6,6 +6,18 @@ int cmp(float x, float y) { return x < y && x > 0.f; } +struct foo { + int x : 10; + unsigned y : 7; + short k:3; +int : 0; + short a:15; +}; + +int bitf(struct foo q) { + return q.x + q.y - q.k + q.a; +} + int main() { int x = 42, *a = &x, |