From 3386b092d8e8b00191ef511ea585fe875578efe7 Mon Sep 17 00:00:00 2001 From: lemon Date: Sun, 14 Sep 2025 23:33:45 +0200 Subject: start implementing bitfields --- test/test4.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/test4.c') 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, -- cgit v1.2.3