aboutsummaryrefslogtreecommitdiff
path: root/testsuite/compilable
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2026-07-19 02:08:06 +0200
committerEugen Wissner <belka@caraus.de>2026-07-19 02:08:06 +0200
commit2e1e95dc716167853be4a4b6acaaee1688142744 (patch)
tree343a27402a2aa0f1f83bc0ca05ad8803310e4959 /testsuite/compilable
parent349e84c693c1444606e877f4d8cdc1a39aa91634 (diff)
downloadelna-2e1e95dc716167853be4a4b6acaaee1688142744.tar.gz
Implement initializer evaluator
Diffstat (limited to 'testsuite/compilable')
-rw-r--r--testsuite/compilable/const_var_chain.elna7
-rw-r--r--testsuite/compilable/traits_size.elna12
2 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/compilable/const_var_chain.elna b/testsuite/compilable/const_var_chain.elna
new file mode 100644
index 0000000..a6db8c8
--- /dev/null
+++ b/testsuite/compilable/const_var_chain.elna
@@ -0,0 +1,7 @@
+var
+ x: const Int := 42
+ y: Int := x
+
+begin
+ assert(y = 42)
+end.
diff --git a/testsuite/compilable/traits_size.elna b/testsuite/compilable/traits_size.elna
new file mode 100644
index 0000000..523045f
--- /dev/null
+++ b/testsuite/compilable/traits_size.elna
@@ -0,0 +1,12 @@
+var
+ i: Int := 1
+ s: Int := cast(#size(Int): Int)
+ a: [10]Int
+ as: Int := cast(#size([10]Int): Int)
+ p: Int := cast(#size(Pointer): Int)
+
+begin
+ assert(s > 0);
+ assert(as = 10 * cast(#size(Int): Int));
+ assert(p > 0)
+end.