From da1e84e33de1a9c2cc1745b8f42bc7f0cee8fc5c Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Fri, 9 Oct 2026 23:35:03 +0200 Subject: Add const sections --- testsuite/runnable/const_section.elna | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 testsuite/runnable/const_section.elna (limited to 'testsuite/runnable/const_section.elna') diff --git a/testsuite/runnable/const_section.elna b/testsuite/runnable/const_section.elna new file mode 100644 index 0000000..a4fde8f --- /dev/null +++ b/testsuite/runnable/const_section.elna @@ -0,0 +1,16 @@ +program() +const + BUFFER_SIZE = 3 +var + arr: [BUFFER_SIZE]Int +begin + arr[1] := 10; + arr[BUFFER_SIZE] := 30; + assert(arr[1] = 10); + assert(arr[3] = 30); + block my_block + const LOCAL_VAL = 42 + begin + assert(LOCAL_VAL = 42) + end +end. -- cgit v1.2.3