bloat-buster/tests/enum_arbitrary_abi.bbb
David Gonzalez Martin 7ad2bca45c
All checks were successful
CI / ci (MinSizeRel, ubuntu-latest) (pull_request) Successful in 34s
CI / ci (Release, ubuntu-latest) (pull_request) Successful in 31s
CI / ci (RelWithDebInfo, ubuntu-latest) (pull_request) Successful in 36s
CI / ci (Debug, ubuntu-latest) (pull_request) Successful in 2m28s
CI / ci (MinSizeRel, ubuntu-latest) (push) Successful in 33s
CI / ci (Release, ubuntu-latest) (push) Successful in 31s
CI / ci (RelWithDebInfo, ubuntu-latest) (push) Successful in 36s
CI / ci (Debug, ubuntu-latest) (push) Successful in 2m29s
Arbitrary enum and target machine in self-hosted
2025-05-31 08:23:55 -06:00

23 lines
276 B
Plaintext

SomeEnum = enum
{
a,
b,
c,
d,
}
foo = fn (arg: SomeEnum) SomeEnum
{
return arg;
}
[export] main = fn [cc(c)] () s32
{
>some_e: SomeEnum = .c;
>a = foo(some_e);
>b = foo(.d);
if (a != .c) #trap();
if (b != .d) #trap();
return 0;
}