52 lines
782 B
Plaintext
52 lines
782 B
Plaintext
require = fn (ok: u1) void
|
|
{
|
|
if (!ok)
|
|
{
|
|
#trap();
|
|
}
|
|
}
|
|
MedStructInts = struct
|
|
{
|
|
x: s32,
|
|
y: s32,
|
|
z: s32,
|
|
}
|
|
|
|
bb_ret_med_struct_ints = fn [cc(c)] () MedStructInts
|
|
{
|
|
return {
|
|
.x = 1,
|
|
.y = 2,
|
|
.z = 3,
|
|
};
|
|
}
|
|
|
|
c_med_struct_ints = fn [cc(c)] (s: MedStructInts) void
|
|
{
|
|
require(s.x == 1);
|
|
require(s.y == 2);
|
|
require(s.z == 3);
|
|
|
|
>s2 = bb_ret_med_struct_ints();
|
|
|
|
require(s2.x == 1);
|
|
require(s2.y == 2);
|
|
require(s2.z == 3);
|
|
}
|
|
|
|
[export] main = fn [cc(c)] () s32
|
|
{
|
|
>med: MedStructInts = {
|
|
.x = 1,
|
|
.y = 2,
|
|
.z = 3,
|
|
};
|
|
c_med_struct_ints(med);
|
|
>med2 = bb_ret_med_struct_ints();
|
|
require(med2.x == 1);
|
|
require(med2.y == 2);
|
|
require(med2.z == 3);
|
|
|
|
return 0;
|
|
}
|