bloat-buster/tests/enum_array.bbb
David Gonzalez Martin f90b527286
Some checks failed
CI / ci (MinSizeRel, ubuntu-latest) (push) Failing after 1m7s
CI / ci (Release, ubuntu-latest) (push) Failing after 1m5s
CI / ci (RelWithDebInfo, ubuntu-latest) (push) Failing after 1m8s
CI / ci (Debug, ubuntu-latest) (push) Failing after 2m30s
Forward declared type
2025-05-24 13:30:05 -06:00

23 lines
383 B
Plaintext

require = fn (ok: u1) void
{
if (!ok) #trap();
}
E = enum
{
a,
b,
c,
d,
}
[export] main = fn [cc(c)] () s32
{
>some_enum_array: enum_array[E](u32) = [ .a = 4, .b = 3, .c = 2, .d = 1 ];
require(some_enum_array[.a] == 4);
require(some_enum_array[.b] == 3);
require(some_enum_array[.c] == 2);
require(some_enum_array[.d] == 1);
return 0;
}