Binary operations from stack
This commit is contained in:
parent
71f70a35fb
commit
f89fb293c0
@ -130,3 +130,11 @@ test "constant_xor" {
|
|||||||
test "minimal_stack" {
|
test "minimal_stack" {
|
||||||
try invsrc(@src());
|
try invsrc(@src());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test "stack_add" {
|
||||||
|
try invsrc(@src());
|
||||||
|
}
|
||||||
|
|
||||||
|
test "stack_sub" {
|
||||||
|
try invsrc(@src());
|
||||||
|
}
|
||||||
|
6
tests/stack_add.bbb
Normal file
6
tests/stack_add.bbb
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[export] main = fn [cc(c)] () s32
|
||||||
|
{
|
||||||
|
>a: s32 = -1;
|
||||||
|
>b: s32 = 1;
|
||||||
|
return a + b;
|
||||||
|
}
|
6
tests/stack_sub.bbb
Normal file
6
tests/stack_sub.bbb
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[export] main = fn [cc(c)] () s32
|
||||||
|
{
|
||||||
|
>a: s32 = 1;
|
||||||
|
>b: s32 = 1;
|
||||||
|
return a - b;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user