harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit d6fd41ad9138898fb1e9aa166e20dcd8381f662a
parent 1e29024ce991bf53aab1b249f31c31d7eab3a8a2
Author: Eyal Sawady <ecs@d2evs.net>
Date:   Fri, 16 Jul 2021 11:37:06 +0000

Add call test

Signed-off-by: Eyal Sawady <ecs@d2evs.net>

Diffstat:
Atests/903-call.ha | 12++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)

diff --git a/tests/903-call.ha b/tests/903-call.ha @@ -0,0 +1,12 @@ +fn foo() size = 2; + +export fn main() int = { + // Indirect + let x: size = foo(); + assert(x == 2); + + // Direct + let x = [1, 2, 3]; + assert(x[foo()] == 3); + return 0; +};