From ac696b22b3f03ae9670a9d1d154ce7ff848b5e55 Mon Sep 17 00:00:00 2001 From: Mel Date: Wed, 6 May 2026 18:48:56 +0200 Subject: Tests for new IR transpiler Signed-off-by: Mel --- boot/tests/transpile/compound_assigns.cskt | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 boot/tests/transpile/compound_assigns.cskt (limited to 'boot/tests/transpile/compound_assigns.cskt') diff --git a/boot/tests/transpile/compound_assigns.cskt b/boot/tests/transpile/compound_assigns.cskt new file mode 100644 index 0000000..e480f31 --- /dev/null +++ b/boot/tests/transpile/compound_assigns.cskt @@ -0,0 +1,27 @@ +compound assigns are desugared during lowering so the c output +only ever has plain assignments. + +<<< + +main = fun () { + var x int = 0 + x += 1 + x *= 2 + x++ + x -= 3 + x-- +} + +>>> + +#include "core.c" +void catskill_main(void); +void catskill_main(void) { + integer x = 0; + x = x + 1; + x = x * 2; + x = x + 1; + x = x - 3; + x = x - 1; +} +#include "runtime.c" -- cgit 1.4.1