wip
This commit is contained in:
parent
a6cd3bf713
commit
a6f19ea6c5
52
tests/tests.bbb
Normal file
52
tests/tests.bbb
Normal file
@ -0,0 +1,52 @@
|
||||
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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user