53 lines
802 B
Plaintext
53 lines
802 B
Plaintext
error() = fn () noreturn
|
|
{
|
|
#trap();
|
|
}
|
|
|
|
return_constant = fn () s32 // This is a comment
|
|
// This is a comment
|
|
{ // This is a comment
|
|
// This is a comment
|
|
return 0; // This is a comment
|
|
}// This is a comment
|
|
// This is a comment
|
|
|
|
constant_add = fn () s32
|
|
{
|
|
return -1 + 1;
|
|
}
|
|
|
|
constant_and = fn () s32
|
|
{
|
|
return 1 & 2;
|
|
}
|
|
|
|
constant_div = fn () s32
|
|
{
|
|
return 0 / 5;
|
|
}
|
|
|
|
constant_mul = fn () s32
|
|
{
|
|
return 1 * 0;
|
|
}
|
|
|
|
[export] main = fn [cc(c)]
|
|
{
|
|
>rc = return_constant();
|
|
if (rc != 0) error();
|
|
|
|
>const_add = constant_add();
|
|
if (const_add != 0) error();
|
|
|
|
>const_and = constant_and();
|
|
if (const_and != 0) error();
|
|
|
|
>const_div = constant_div();
|
|
if (const_div != 0) error();
|
|
|
|
>const_mul = constant_mul();
|
|
if (const_mul != 0) error();
|
|
|
|
return 0;
|
|
}
|