diff options
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" |
