From 8539c10542a4be1e1127daea60bf1b1e4c37e092 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sat, 1 Aug 2026 09:30:39 +0200 Subject: Fix compile-time negation and array access --- testsuite/compilable/const_negation.elna | 8 ++++++++ testsuite/runnable/compile_time_array_access.elna | 7 +++++++ 2 files changed, 15 insertions(+) create mode 100644 testsuite/compilable/const_negation.elna create mode 100644 testsuite/runnable/compile_time_array_access.elna (limited to 'testsuite') diff --git a/testsuite/compilable/const_negation.elna b/testsuite/compilable/const_negation.elna new file mode 100644 index 0000000..a62cc1e --- /dev/null +++ b/testsuite/compilable/const_negation.elna @@ -0,0 +1,8 @@ +var + x: const Int := -5 + y: const Int := -x + +begin + assert(x = -5); + assert(y = 5); +end. diff --git a/testsuite/runnable/compile_time_array_access.elna b/testsuite/runnable/compile_time_array_access.elna new file mode 100644 index 0000000..566f3be --- /dev/null +++ b/testsuite/runnable/compile_time_array_access.elna @@ -0,0 +1,7 @@ +var + array: const [3]Int := [3]Int{ 1, 2, 3 } + i: const Int := array[2] + +begin + assert(i = 2) +end. -- cgit v1.2.3