From bffbde3be34ce854e169ad2296f44416414fbc75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edvard=20Th=C3=B6rnros?= Date: Sun, 7 Mar 2021 15:27:19 +0100 Subject: add failing tests --- progs/tests/global_collision.sy | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 progs/tests/global_collision.sy (limited to 'progs/tests/global_collision.sy') diff --git a/progs/tests/global_collision.sy b/progs/tests/global_collision.sy new file mode 100644 index 0000000..8dba295 --- /dev/null +++ b/progs/tests/global_collision.sy @@ -0,0 +1,11 @@ +// TODO(ed): Pure functions +fac :: fn a: int -> int { + if a < 1 { ret 1 } + ret a * fac! a - 1 +} + +a :: fac! 4 + +start :: fn { + a <=> 24 +} -- cgit v1.2.1 From d96ca7b986573a98cefdb67026516fd014a93c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Sun, 7 Mar 2021 16:07:36 +0100 Subject: fix parameters colliding with global variables --- progs/tests/global_collision.sy | 1 - 1 file changed, 1 deletion(-) (limited to 'progs/tests/global_collision.sy') diff --git a/progs/tests/global_collision.sy b/progs/tests/global_collision.sy index 8dba295..6bce509 100644 --- a/progs/tests/global_collision.sy +++ b/progs/tests/global_collision.sy @@ -1,4 +1,3 @@ -// TODO(ed): Pure functions fac :: fn a: int -> int { if a < 1 { ret 1 } ret a * fac! a - 1 -- cgit v1.2.1