diff options
| author | Eugen Wissner <belka@caraus.de> | 2024-12-08 16:19:52 +0100 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2024-12-08 16:19:52 +0100 |
| commit | 7fc90f1d2d1686ccf928418b91c043b1d6d9ced2 (patch) | |
| tree | 8cc948ac2e60881c4828538866137f4495e4a554 /tests | |
| parent | 1c996b3c8bb290d17e4d0dcdf809c8458866bb12 (diff) | |
| download | elna-7fc90f1d2d1686ccf928418b91c043b1d6d9ced2.tar.gz | |
Calculate stack offset from array index
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/expectations/array_with_variable_index.txt | 2 | ||||
| -rw-r--r-- | tests/vm/array_with_variable_index.elna | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/expectations/array_with_variable_index.txt b/tests/expectations/array_with_variable_index.txt new file mode 100644 index 0000000..b3172d1 --- /dev/null +++ b/tests/expectations/array_with_variable_index.txt @@ -0,0 +1,2 @@ +5 +7 diff --git a/tests/vm/array_with_variable_index.elna b/tests/vm/array_with_variable_index.elna new file mode 100644 index 0000000..c3449b3 --- /dev/null +++ b/tests/vm/array_with_variable_index.elna @@ -0,0 +1,11 @@ +proc main() { + var a: array[2] of int; + var i: int; + + i := 1; + a[0] := 5; + a[i] := 7; + + printi(a[0]); + printi(a[i]); +} |
