bloat-buster/tests/return_small_struct.bbb
David Gonzalez Martin 2be7142608
All checks were successful
CI / ci (ReleaseFast, ubuntu-latest) (pull_request) Successful in 2m25s
CI / ci (ReleaseSmall, ubuntu-latest) (pull_request) Successful in 2m22s
CI / ci (ReleaseSafe, ubuntu-latest) (pull_request) Successful in 2m29s
CI / ci (Debug, ubuntu-latest) (pull_request) Successful in 3m47s
CI / ci (ReleaseFast, ubuntu-latest) (push) Successful in 2m39s
CI / ci (ReleaseSmall, ubuntu-latest) (push) Successful in 2m37s
CI / ci (ReleaseSafe, ubuntu-latest) (push) Successful in 2m44s
CI / ci (Debug, ubuntu-latest) (push) Successful in 4m2s
Arbitrary-bit fields inside structs
2025-04-21 07:00:08 -06:00

21 lines
220 B
Plaintext

S = struct
{
a: u1,
b: u1,
}
foo = fn [cc(c)] () S
{
return { .a = 1, .b = 0 };
}
[export] main = fn [cc(c)] () s32
{
>s = foo();
if (s.a != 1) #trap();
if (s.b != 0) #trap();
return 0;
}