diff options
| author | Mel <mel@rnrd.eu> | 2026-05-06 18:48:56 +0200 |
|---|---|---|
| committer | Mel <mel@rnrd.eu> | 2026-05-06 18:48:56 +0200 |
| commit | ac696b22b3f03ae9670a9d1d154ce7ff848b5e55 (patch) | |
| tree | e1f7ac3e1cd1f545d1ab0c1dc5c19130a9b23c5f /boot/tests/transpile/compound_assigns.cskt | |
| parent | 3850a7b311bca7bae925aeea456a41036f116ebd (diff) | |
| download | catskill-ac696b22b3f03ae9670a9d1d154ce7ff848b5e55.tar.zst catskill-ac696b22b3f03ae9670a9d1d154ce7ff848b5e55.zip | |
Tests for new IR transpiler
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'boot/tests/transpile/compound_assigns.cskt')
| -rw-r--r-- | boot/tests/transpile/compound_assigns.cskt | 27 |
1 files changed, 27 insertions, 0 deletions
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" |
