All checks were successful
CI / ci (MinSizeRel, ubuntu-latest) (pull_request) Successful in 1m10s
CI / ci (Release, ubuntu-latest) (pull_request) Successful in 1m9s
CI / ci (RelWithDebInfo, ubuntu-latest) (pull_request) Successful in 1m13s
CI / ci (Debug, ubuntu-latest) (pull_request) Successful in 2m44s
CI / ci (MinSizeRel, ubuntu-latest) (push) Successful in 1m5s
CI / ci (RelWithDebInfo, ubuntu-latest) (push) Successful in 1m5s
CI / ci (Release, ubuntu-latest) (push) Successful in 1m4s
CI / ci (Debug, ubuntu-latest) (push) Successful in 2m37s
16 lines
415 B
Plaintext
16 lines
415 B
Plaintext
foo = macro[T](addr: &u64, count: u64) []T
|
|
{
|
|
>pointer: &T = #pointer_cast(addr);
|
|
return pointer[..count];
|
|
}
|
|
|
|
[export] main = fn [cc(c)] () s32
|
|
{
|
|
>address_raw: u64 = 0xaaaaaaaaaaaaaaaa;
|
|
>some_var: &u64 = #pointer_from_int(address_raw);
|
|
>result: []&u8 = foo[&u8](some_var, 1);
|
|
if (#int_from_pointer(result.pointer) != address_raw) #trap();
|
|
if (result.length != 1) #trap();
|
|
return 0;
|
|
}
|