diff options
| author | Eugen Wissner <belka@caraus.de> | 2024-11-24 13:05:11 +0100 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2024-11-26 23:44:25 +0100 |
| commit | f7b36cb81d96817d1c69ffe9025b88112de7400c (patch) | |
| tree | c3846bafd78045b3dfff5c021ed82443868590b3 /tests | |
| parent | 0c9799b887e967a55857377dad0d64ad625b47c9 (diff) | |
| download | elna-f7b36cb81d96817d1c69ffe9025b88112de7400c.tar.gz | |
Implement the while loop
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/expectations/print_after_loop.txt | 1 | ||||
| -rw-r--r-- | tests/expectations/print_in_proc.txt | 1 | ||||
| -rw-r--r-- | tests/vm/print_after_loop.elna | 9 | ||||
| -rw-r--r-- | tests/vm/print_in_proc.elna | 7 |
4 files changed, 18 insertions, 0 deletions
diff --git a/tests/expectations/print_after_loop.txt b/tests/expectations/print_after_loop.txt new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/tests/expectations/print_after_loop.txt @@ -0,0 +1 @@ +2 diff --git a/tests/expectations/print_in_proc.txt b/tests/expectations/print_in_proc.txt new file mode 100644 index 0000000..8351c19 --- /dev/null +++ b/tests/expectations/print_in_proc.txt @@ -0,0 +1 @@ +14 diff --git a/tests/vm/print_after_loop.elna b/tests/vm/print_after_loop.elna new file mode 100644 index 0000000..3fd9175 --- /dev/null +++ b/tests/vm/print_after_loop.elna @@ -0,0 +1,9 @@ +proc main() { + var x: int; + + x := 0; + while (x < 2) { + x := x + 1; + } + printi(x); +} diff --git a/tests/vm/print_in_proc.elna b/tests/vm/print_in_proc.elna new file mode 100644 index 0000000..8c4588b --- /dev/null +++ b/tests/vm/print_in_proc.elna @@ -0,0 +1,7 @@ +proc print2(a: int) { + printi(a); +} + +proc main() { + print2(14); +} |
