aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/compilable/assign_record_to_base.elna1
-rw-r--r--testsuite/compilable/const_alias.elna1
-rw-r--r--testsuite/compilable/const_element_array.elna1
-rw-r--r--testsuite/compilable/const_extern.elna1
-rw-r--r--testsuite/compilable/const_negation.elna1
-rw-r--r--testsuite/compilable/const_var_chain.elna1
-rw-r--r--testsuite/compilable/empty_proc_type_expression.elna4
-rw-r--r--testsuite/compilable/opaque_type.elna1
-rw-r--r--testsuite/compilable/pointer_cast.elna3
-rw-r--r--testsuite/compilable/pointer_const_conversion.elna1
-rw-r--r--testsuite/compilable/self-referencing-record.elna1
-rw-r--r--testsuite/compilable/take_const_address.elna1
-rw-r--r--testsuite/compilable/traits_size.elna1
-rw-r--r--testsuite/fail_compilation/assign_array_length.elna1
-rw-r--r--testsuite/fail_compilation/assign_const_to_pointer.elna1
-rw-r--r--testsuite/fail_compilation/assign_from_const_pointer.elna1
-rw-r--r--testsuite/fail_compilation/assign_slice_ptr.elna1
-rw-r--r--testsuite/fail_compilation/assign_to_call_result_field.elna1
-rw-r--r--testsuite/fail_compilation/assign_to_slicing.elna1
-rw-r--r--testsuite/fail_compilation/assign_void_call.elna1
-rw-r--r--testsuite/fail_compilation/case_label_overflow.elna1
-rw-r--r--testsuite/fail_compilation/case_non_constant.elna1
-rw-r--r--testsuite/fail_compilation/case_type_mismatch.elna1
-rw-r--r--testsuite/fail_compilation/case_unique_label.elna1
-rw-r--r--testsuite/fail_compilation/compare_unrelated_records.elna1
-rw-r--r--testsuite/fail_compilation/constant_enum_to_int.elna1
-rw-r--r--testsuite/fail_compilation/import_local_collision/helper.elna4
-rw-r--r--testsuite/fail_compilation/import_local_collision/sut.elna3
-rw-r--r--testsuite/fail_compilation/non_constant_array_dimension.elna1
-rw-r--r--testsuite/fail_compilation/opaque_pointer_arithmetic.elna1
-rw-r--r--testsuite/fail_compilation/opaque_slice_element.elna1
-rw-r--r--testsuite/fail_compilation/pointer-cycle.elna1
-rw-r--r--testsuite/fail_compilation/proc_type_without_parameters.elna1
-rw-r--r--testsuite/fail_compilation/procedure-cycle.elna1
-rw-r--r--testsuite/fail_compilation/record-base-cycle-indirect.elna1
-rw-r--r--testsuite/fail_compilation/record-base-cycle.elna1
-rw-r--r--testsuite/fail_compilation/record_base_constructor_type_mismatch.elna1
-rw-r--r--testsuite/fail_compilation/record_duplicate_field.elna1
-rw-r--r--testsuite/fail_compilation/record_duplicate_field_import_base/sut.elna1
-rw-r--r--testsuite/fail_compilation/redefined_variable.elna1
-rw-r--r--testsuite/fail_compilation/reference_call_result_field.elna1
-rw-r--r--testsuite/fail_compilation/reference_literal.elna1
-rw-r--r--testsuite/fail_compilation/reference_slicing.elna1
-rw-r--r--testsuite/fail_compilation/slice-cycle.elna1
-rw-r--r--testsuite/fail_compilation/while_condition.elna1
-rw-r--r--testsuite/runnable/aggregate_argument.elna1
-rw-r--r--testsuite/runnable/aggregate_equality.elna1
-rw-r--r--testsuite/runnable/array_constructor.elna1
-rw-r--r--testsuite/runnable/binary_literal.elna1
-rw-r--r--testsuite/runnable/case_constant_label.elna1
-rw-r--r--testsuite/runnable/case_else.elna1
-rw-r--r--testsuite/runnable/case_int.elna1
-rw-r--r--testsuite/runnable/case_multilabel.elna1
-rw-r--r--testsuite/runnable/case_record.elna1
-rw-r--r--testsuite/runnable/compile_time_array_access.elna1
-rw-r--r--testsuite/runnable/const_copy.elna1
-rw-r--r--testsuite/runnable/const_initialization.elna1
-rw-r--r--testsuite/runnable/constant_string_initializer.elna1
-rw-r--r--testsuite/runnable/define_multiple_local_variables.elna1
-rw-r--r--testsuite/runnable/exported_variable/sut.elna1
-rw-r--r--testsuite/runnable/fixed_int_max.elna1
-rw-r--r--testsuite/runnable/fixed_int_min.elna1
-rw-r--r--testsuite/runnable/fixed_word_max.elna1
-rw-r--r--testsuite/runnable/float_arithmetic.elna1
-rw-r--r--testsuite/runnable/for_each_array.elna1
-rw-r--r--testsuite/runnable/for_each_slice.elna1
-rw-r--r--testsuite/runnable/for_with.elna1
-rw-r--r--testsuite/runnable/generic_pointer_arithmetic.elna1
-rw-r--r--testsuite/runnable/hexadecimal_literal.elna1
-rw-r--r--testsuite/runnable/multi_module/sut.elna1
-rw-r--r--testsuite/runnable/procedure_cast.elna1
-rw-r--r--testsuite/runnable/record_base_assignment.elna1
-rw-r--r--testsuite/runnable/record_base_constructor.elna1
-rw-r--r--testsuite/runnable/record_construction.elna1
-rw-r--r--testsuite/runnable/record_extension.elna1
-rw-r--r--testsuite/runnable/record_layout.elna1
-rw-r--r--testsuite/runnable/recursive_record.elna1
-rw-r--r--testsuite/runnable/repeat_loop.elna1
-rw-r--r--testsuite/runnable/return_aggregate.elna1
-rw-r--r--testsuite/runnable/slice_array.elna1
-rw-r--r--testsuite/runnable/slice_cast.elna1
-rw-r--r--testsuite/runnable/slice_equality.elna1
-rw-r--r--testsuite/runnable/slice_pointer.elna1
-rw-r--r--testsuite/runnable/slice_slice.elna1
-rw-r--r--testsuite/runnable/two_fields_same_type.elna2
-rw-r--r--testsuite/runnable/two_parameters_same_type.elna1
-rw-r--r--testsuite/runnable/unary_plus.elna1
-rw-r--r--testsuite/runnable/unicode_escape_character.elna1
-rw-r--r--testsuite/runnable/unicode_escape_string.elna1
89 files changed, 86 insertions, 14 deletions
diff --git a/testsuite/compilable/assign_record_to_base.elna b/testsuite/compilable/assign_record_to_base.elna
index fb28e7b..7601d06 100644
--- a/testsuite/compilable/assign_record_to_base.elna
+++ b/testsuite/compilable/assign_record_to_base.elna
@@ -10,6 +10,7 @@ var
x: ^B := nil
y: ^R := nil
+program()
begin
x := y;
end.
diff --git a/testsuite/compilable/const_alias.elna b/testsuite/compilable/const_alias.elna
index e17c55f..3a6b365 100644
--- a/testsuite/compilable/const_alias.elna
+++ b/testsuite/compilable/const_alias.elna
@@ -6,5 +6,4 @@ var
x: CCI := 8
y: const CI := 9
-begin
end.
diff --git a/testsuite/compilable/const_element_array.elna b/testsuite/compilable/const_element_array.elna
index a812d23..2d68ff5 100644
--- a/testsuite/compilable/const_element_array.elna
+++ b/testsuite/compilable/const_element_array.elna
@@ -5,5 +5,4 @@ var
a: [3]CI := [1, 2, 3]
b: [3]CI
-begin
end.
diff --git a/testsuite/compilable/const_extern.elna b/testsuite/compilable/const_extern.elna
index 8df801e..9e8fbb0 100644
--- a/testsuite/compilable/const_extern.elna
+++ b/testsuite/compilable/const_extern.elna
@@ -1,5 +1,4 @@
var
errno_like: const Int := extern
-begin
end.
diff --git a/testsuite/compilable/const_negation.elna b/testsuite/compilable/const_negation.elna
index a62cc1e..cb76e58 100644
--- a/testsuite/compilable/const_negation.elna
+++ b/testsuite/compilable/const_negation.elna
@@ -2,6 +2,7 @@ var
x: const Int := -5
y: const Int := -x
+program()
begin
assert(x = -5);
assert(y = 5);
diff --git a/testsuite/compilable/const_var_chain.elna b/testsuite/compilable/const_var_chain.elna
index a6db8c8..5a3623f 100644
--- a/testsuite/compilable/const_var_chain.elna
+++ b/testsuite/compilable/const_var_chain.elna
@@ -2,6 +2,7 @@ var
x: const Int := 42
y: Int := x
+program()
begin
assert(y = 42)
end.
diff --git a/testsuite/compilable/empty_proc_type_expression.elna b/testsuite/compilable/empty_proc_type_expression.elna
index ad959f3..7738cae 100644
--- a/testsuite/compilable/empty_proc_type_expression.elna
+++ b/testsuite/compilable/empty_proc_type_expression.elna
@@ -1,2 +1,4 @@
-type P = proc()
+type
+ P = proc()
+
end.
diff --git a/testsuite/compilable/opaque_type.elna b/testsuite/compilable/opaque_type.elna
index bdbf0d6..fdb2928 100644
--- a/testsuite/compilable/opaque_type.elna
+++ b/testsuite/compilable/opaque_type.elna
@@ -9,6 +9,7 @@ var
proc take(h: ^Handle) -> ^Handle
return h
+program()
begin
alias := take(handle)
end.
diff --git a/testsuite/compilable/pointer_cast.elna b/testsuite/compilable/pointer_cast.elna
index ab4b071..3807d69 100644
--- a/testsuite/compilable/pointer_cast.elna
+++ b/testsuite/compilable/pointer_cast.elna
@@ -2,7 +2,8 @@ var
c: ^Char := nil
p: Pointer := nil
+program()
begin
p := c;
- c := p;
+ c := p
end.
diff --git a/testsuite/compilable/pointer_const_conversion.elna b/testsuite/compilable/pointer_const_conversion.elna
index fd8e097..d2328ae 100644
--- a/testsuite/compilable/pointer_const_conversion.elna
+++ b/testsuite/compilable/pointer_const_conversion.elna
@@ -2,6 +2,7 @@ var
x: Int
p: ^const Int
+program()
begin
p := @x
end.
diff --git a/testsuite/compilable/self-referencing-record.elna b/testsuite/compilable/self-referencing-record.elna
index cc98f86..311f148 100644
--- a/testsuite/compilable/self-referencing-record.elna
+++ b/testsuite/compilable/self-referencing-record.elna
@@ -2,4 +2,5 @@ type
R = record
field: ^R
end
+
end.
diff --git a/testsuite/compilable/take_const_address.elna b/testsuite/compilable/take_const_address.elna
index f8c9e5c..71c8e0b 100644
--- a/testsuite/compilable/take_const_address.elna
+++ b/testsuite/compilable/take_const_address.elna
@@ -2,6 +2,7 @@ var
x: ^const Int
y: const Int := 1
+program()
begin
x := @y
end.
diff --git a/testsuite/compilable/traits_size.elna b/testsuite/compilable/traits_size.elna
index 523045f..7ee46f1 100644
--- a/testsuite/compilable/traits_size.elna
+++ b/testsuite/compilable/traits_size.elna
@@ -5,6 +5,7 @@ var
as: Int := cast(#size([10]Int): Int)
p: Int := cast(#size(Pointer): Int)
+program()
begin
assert(s > 0);
assert(as = 10 * cast(#size(Int): Int));
diff --git a/testsuite/fail_compilation/assign_array_length.elna b/testsuite/fail_compilation/assign_array_length.elna
index ac8f9df..bf6f96c 100644
--- a/testsuite/fail_compilation/assign_array_length.elna
+++ b/testsuite/fail_compilation/assign_array_length.elna
@@ -2,6 +2,7 @@ var
slice: []Int
array: [2]Int
+program()
begin
array.length := slice.length (* @Error Cannot assign to a value of type 'const Word', because it is constant or contains constant members *)
end.
diff --git a/testsuite/fail_compilation/assign_const_to_pointer.elna b/testsuite/fail_compilation/assign_const_to_pointer.elna
index 87047e5..7e26679 100644
--- a/testsuite/fail_compilation/assign_const_to_pointer.elna
+++ b/testsuite/fail_compilation/assign_const_to_pointer.elna
@@ -2,6 +2,7 @@ var
c: const Int := 2
p: Pointer
+program()
begin
p := @c (* @Error Expected type 'Pointer', but got '\^const Int' *)
end.
diff --git a/testsuite/fail_compilation/assign_from_const_pointer.elna b/testsuite/fail_compilation/assign_from_const_pointer.elna
index c39d5cd..5dc050d 100644
--- a/testsuite/fail_compilation/assign_from_const_pointer.elna
+++ b/testsuite/fail_compilation/assign_from_const_pointer.elna
@@ -2,6 +2,7 @@ var
cv: const Pointer := nil
p: Pointer
+program()
begin
p := cv (* @Error Expected type 'Pointer', but got 'const Pointer' *)
end.
diff --git a/testsuite/fail_compilation/assign_slice_ptr.elna b/testsuite/fail_compilation/assign_slice_ptr.elna
index aa7a379..6f09f00 100644
--- a/testsuite/fail_compilation/assign_slice_ptr.elna
+++ b/testsuite/fail_compilation/assign_slice_ptr.elna
@@ -2,6 +2,7 @@ var
slice: []Int
array: [2]Int
+program()
begin
slice.ptr := array.ptr (* @Error Cannot assign to a value of type 'const \^Int', because it is constant or contains constant members *)
end.
diff --git a/testsuite/fail_compilation/assign_to_call_result_field.elna b/testsuite/fail_compilation/assign_to_call_result_field.elna
index 509b2dd..25096ed 100644
--- a/testsuite/fail_compilation/assign_to_call_result_field.elna
+++ b/testsuite/fail_compilation/assign_to_call_result_field.elna
@@ -10,6 +10,7 @@ begin
result.x := 1
return result
+program()
begin
make().x := 5 (* @Error Expression of type 'Int' is not addressable *)
end.
diff --git a/testsuite/fail_compilation/assign_to_slicing.elna b/testsuite/fail_compilation/assign_to_slicing.elna
index 2266431..6743e06 100644
--- a/testsuite/fail_compilation/assign_to_slicing.elna
+++ b/testsuite/fail_compilation/assign_to_slicing.elna
@@ -2,6 +2,7 @@ var
s: [3]Int
t: [2]Int
+program()
begin
s[1 to 2] := t[1 to 2] (* @Error Expression of type '\[\]Int' is not addressable *)
end.
diff --git a/testsuite/fail_compilation/assign_void_call.elna b/testsuite/fail_compilation/assign_void_call.elna
index d18b1c8..381bb06 100644
--- a/testsuite/fail_compilation/assign_void_call.elna
+++ b/testsuite/fail_compilation/assign_void_call.elna
@@ -4,6 +4,7 @@ var
proc v()
return
+program()
begin
x := v() (* @Error Expected type 'Int', but the expression has no value *)
end.
diff --git a/testsuite/fail_compilation/case_label_overflow.elna b/testsuite/fail_compilation/case_label_overflow.elna
index ab6dbfd..787f043 100644
--- a/testsuite/fail_compilation/case_label_overflow.elna
+++ b/testsuite/fail_compilation/case_label_overflow.elna
@@ -1,6 +1,7 @@
var
x: Int8 := 100i8
+program()
begin
case x of
100i8: assert(true)
diff --git a/testsuite/fail_compilation/case_non_constant.elna b/testsuite/fail_compilation/case_non_constant.elna
index dc69703..a446c29 100644
--- a/testsuite/fail_compilation/case_non_constant.elna
+++ b/testsuite/fail_compilation/case_non_constant.elna
@@ -8,6 +8,7 @@ var
r: R
x: R
+program()
begin
x := r;
case x of
diff --git a/testsuite/fail_compilation/case_type_mismatch.elna b/testsuite/fail_compilation/case_type_mismatch.elna
index 9cdae38..57afd1f 100644
--- a/testsuite/fail_compilation/case_type_mismatch.elna
+++ b/testsuite/fail_compilation/case_type_mismatch.elna
@@ -1,6 +1,7 @@
var
x: Int
+program()
begin
case x of
1: (* ok *)
diff --git a/testsuite/fail_compilation/case_unique_label.elna b/testsuite/fail_compilation/case_unique_label.elna
index a97fb37..7ee8391 100644
--- a/testsuite/fail_compilation/case_unique_label.elna
+++ b/testsuite/fail_compilation/case_unique_label.elna
@@ -1,3 +1,4 @@
+program()
begin
case 3 of
1:
diff --git a/testsuite/fail_compilation/compare_unrelated_records.elna b/testsuite/fail_compilation/compare_unrelated_records.elna
index 71eaeda..1699406 100644
--- a/testsuite/fail_compilation/compare_unrelated_records.elna
+++ b/testsuite/fail_compilation/compare_unrelated_records.elna
@@ -12,6 +12,7 @@ var
b: B
ok: Bool
+program()
begin
ok := b = a (* @Error Invalid operands of type 'B' and 'A' for operator = *)
end.
diff --git a/testsuite/fail_compilation/constant_enum_to_int.elna b/testsuite/fail_compilation/constant_enum_to_int.elna
index 4be6131..52c31c3 100644
--- a/testsuite/fail_compilation/constant_enum_to_int.elna
+++ b/testsuite/fail_compilation/constant_enum_to_int.elna
@@ -5,6 +5,7 @@ var
x: [3]Int := [1, 2, 3]
y: []Int
+program()
begin
y := x[Enumeration.one to Enumeration.two] (* @Error Array index must be an integral type, but got 'Enumeration' *)
end.
diff --git a/testsuite/fail_compilation/import_local_collision/helper.elna b/testsuite/fail_compilation/import_local_collision/helper.elna
index d6e3712..e60ca8e 100644
--- a/testsuite/fail_compilation/import_local_collision/helper.elna
+++ b/testsuite/fail_compilation/import_local_collision/helper.elna
@@ -1,6 +1,4 @@
var
- X*: Int
+ X*: Int := 1
-begin
- X := 1
end.
diff --git a/testsuite/fail_compilation/import_local_collision/sut.elna b/testsuite/fail_compilation/import_local_collision/sut.elna
index a9de9c9..8b52586 100644
--- a/testsuite/fail_compilation/import_local_collision/sut.elna
+++ b/testsuite/fail_compilation/import_local_collision/sut.elna
@@ -3,5 +3,6 @@ import helper
var
X: Int (* @Error Symbol 'X' has been already defined *)
-begin
+program()
+
end.
diff --git a/testsuite/fail_compilation/non_constant_array_dimension.elna b/testsuite/fail_compilation/non_constant_array_dimension.elna
index 4ab0d34..e3661c7 100644
--- a/testsuite/fail_compilation/non_constant_array_dimension.elna
+++ b/testsuite/fail_compilation/non_constant_array_dimension.elna
@@ -4,6 +4,7 @@ var
begin
return
+program()
begin
f(5)
end.
diff --git a/testsuite/fail_compilation/opaque_pointer_arithmetic.elna b/testsuite/fail_compilation/opaque_pointer_arithmetic.elna
index 307aed8..0223cc8 100644
--- a/testsuite/fail_compilation/opaque_pointer_arithmetic.elna
+++ b/testsuite/fail_compilation/opaque_pointer_arithmetic.elna
@@ -4,6 +4,7 @@ type
var
p: ^Handle
+program()
begin
p := p + 1 (* @Error Opaque type 'Handle' cannot be used as an element type in pointer arithmetic *)
end.
diff --git a/testsuite/fail_compilation/opaque_slice_element.elna b/testsuite/fail_compilation/opaque_slice_element.elna
index 0f28dae..f50be8a 100644
--- a/testsuite/fail_compilation/opaque_slice_element.elna
+++ b/testsuite/fail_compilation/opaque_slice_element.elna
@@ -4,5 +4,4 @@ type
var
s: []Handle (* @Error Opaque type 'Handle' cannot be used to declare a variable *)
-begin
end.
diff --git a/testsuite/fail_compilation/pointer-cycle.elna b/testsuite/fail_compilation/pointer-cycle.elna
index f9ee649..fe0258a 100644
--- a/testsuite/fail_compilation/pointer-cycle.elna
+++ b/testsuite/fail_compilation/pointer-cycle.elna
@@ -1,3 +1,4 @@
type
A = ^A (* @Error Type declaration forms a cycle: A -> A *)
+
end.
diff --git a/testsuite/fail_compilation/proc_type_without_parameters.elna b/testsuite/fail_compilation/proc_type_without_parameters.elna
index 92514f6..3868e1b 100644
--- a/testsuite/fail_compilation/proc_type_without_parameters.elna
+++ b/testsuite/fail_compilation/proc_type_without_parameters.elna
@@ -4,6 +4,7 @@ var
proc f()
return
+program()
begin
x := f (* @Error Expected type 'Int', but got 'proc\(\)' *)
end.
diff --git a/testsuite/fail_compilation/procedure-cycle.elna b/testsuite/fail_compilation/procedure-cycle.elna
index 796cccf..2284605 100644
--- a/testsuite/fail_compilation/procedure-cycle.elna
+++ b/testsuite/fail_compilation/procedure-cycle.elna
@@ -1,3 +1,4 @@
type
A = proc() -> A (* @Error Type declaration forms a cycle: A -> A *)
+
end.
diff --git a/testsuite/fail_compilation/record-base-cycle-indirect.elna b/testsuite/fail_compilation/record-base-cycle-indirect.elna
index 412e6ea..1ea6ca5 100644
--- a/testsuite/fail_compilation/record-base-cycle-indirect.elna
+++ b/testsuite/fail_compilation/record-base-cycle-indirect.elna
@@ -9,5 +9,6 @@ type
var
v: A
+program()
begin
end.
diff --git a/testsuite/fail_compilation/record-base-cycle.elna b/testsuite/fail_compilation/record-base-cycle.elna
index f3bcb20..8af254d 100644
--- a/testsuite/fail_compilation/record-base-cycle.elna
+++ b/testsuite/fail_compilation/record-base-cycle.elna
@@ -1,4 +1,5 @@
type
R = record(R) (* @Error Type declaration forms a cycle: R -> R *)
end
+
end.
diff --git a/testsuite/fail_compilation/record_base_constructor_type_mismatch.elna b/testsuite/fail_compilation/record_base_constructor_type_mismatch.elna
index 85c93c1..fbba47c 100644
--- a/testsuite/fail_compilation/record_base_constructor_type_mismatch.elna
+++ b/testsuite/fail_compilation/record_base_constructor_type_mismatch.elna
@@ -9,6 +9,7 @@ type
var
c: Child
+program()
begin
c := Child{a: "wrong", b: 9} (* @Error Expected type 'Int', but got '\[\]const Word8' *)
end.
diff --git a/testsuite/fail_compilation/record_duplicate_field.elna b/testsuite/fail_compilation/record_duplicate_field.elna
index b98f990..5cf69a9 100644
--- a/testsuite/fail_compilation/record_duplicate_field.elna
+++ b/testsuite/fail_compilation/record_duplicate_field.elna
@@ -4,5 +4,4 @@ type
x: Int (* @Error Record already has a field named 'x' *)
end
-begin
end.
diff --git a/testsuite/fail_compilation/record_duplicate_field_import_base/sut.elna b/testsuite/fail_compilation/record_duplicate_field_import_base/sut.elna
index 7530017..58f2f3d 100644
--- a/testsuite/fail_compilation/record_duplicate_field_import_base/sut.elna
+++ b/testsuite/fail_compilation/record_duplicate_field_import_base/sut.elna
@@ -6,5 +6,4 @@ type
z: Int
end
-begin
end.
diff --git a/testsuite/fail_compilation/redefined_variable.elna b/testsuite/fail_compilation/redefined_variable.elna
index 9cf8c24..905f6ed 100644
--- a/testsuite/fail_compilation/redefined_variable.elna
+++ b/testsuite/fail_compilation/redefined_variable.elna
@@ -2,5 +2,4 @@ var
x: Int
x: Int (* @Error Symbol 'x' has been already defined *)
-begin
end.
diff --git a/testsuite/fail_compilation/reference_call_result_field.elna b/testsuite/fail_compilation/reference_call_result_field.elna
index 5051cc8..2a721f4 100644
--- a/testsuite/fail_compilation/reference_call_result_field.elna
+++ b/testsuite/fail_compilation/reference_call_result_field.elna
@@ -13,6 +13,7 @@ begin
result.x := 1
return result
+program()
begin
p := @make().x (* @Error Expression of type 'Int' is not addressable *)
end.
diff --git a/testsuite/fail_compilation/reference_literal.elna b/testsuite/fail_compilation/reference_literal.elna
index 1967243..1eef82f 100644
--- a/testsuite/fail_compilation/reference_literal.elna
+++ b/testsuite/fail_compilation/reference_literal.elna
@@ -1,6 +1,7 @@
var
p: ^Int
+program()
begin
p := @5 (* @Error Expression of type 'Int' is not addressable *)
end.
diff --git a/testsuite/fail_compilation/reference_slicing.elna b/testsuite/fail_compilation/reference_slicing.elna
index fac8ec6..078b48a 100644
--- a/testsuite/fail_compilation/reference_slicing.elna
+++ b/testsuite/fail_compilation/reference_slicing.elna
@@ -2,6 +2,7 @@ var
s: [3]Int
p: ^Int
+program()
begin
p := @s[1 to 2] (* @Error Expression of type '\[\]Int' is not addressable *)
end.
diff --git a/testsuite/fail_compilation/slice-cycle.elna b/testsuite/fail_compilation/slice-cycle.elna
index 39eb7db..fe0a3e1 100644
--- a/testsuite/fail_compilation/slice-cycle.elna
+++ b/testsuite/fail_compilation/slice-cycle.elna
@@ -1,3 +1,4 @@
type
A = []A (* @Error Type declaration forms a cycle: A -> A *)
+
end.
diff --git a/testsuite/fail_compilation/while_condition.elna b/testsuite/fail_compilation/while_condition.elna
index 1e17489..bd54796 100644
--- a/testsuite/fail_compilation/while_condition.elna
+++ b/testsuite/fail_compilation/while_condition.elna
@@ -1,3 +1,4 @@
+program()
begin
while 1 do (* @Error Condition must be a boolean expression, but got 'Int' *)
end
diff --git a/testsuite/runnable/aggregate_argument.elna b/testsuite/runnable/aggregate_argument.elna
index 875265e..7aa6ea0 100644
--- a/testsuite/runnable/aggregate_argument.elna
+++ b/testsuite/runnable/aggregate_argument.elna
@@ -7,6 +7,7 @@ type
proc f(r: R) -> Bool
return r.a = 1 & r.b = 2
+program()
begin
assert(f(R{a: 1, b: 2}))
end.
diff --git a/testsuite/runnable/aggregate_equality.elna b/testsuite/runnable/aggregate_equality.elna
index bfe2174..b8da9e9 100644
--- a/testsuite/runnable/aggregate_equality.elna
+++ b/testsuite/runnable/aggregate_equality.elna
@@ -7,6 +7,7 @@ type
proc f() -> Bool
return R{a: 1, b: 2} = R{a: 1, b: 2}
+program()
begin
assert(f())
end.
diff --git a/testsuite/runnable/array_constructor.elna b/testsuite/runnable/array_constructor.elna
index 0e7b08b..aa1c43c 100644
--- a/testsuite/runnable/array_constructor.elna
+++ b/testsuite/runnable/array_constructor.elna
@@ -2,6 +2,7 @@ var
a: [3]Int := [1, 2, 3]
b: [2]Int := [4, 0]
+program()
begin
assert(a[1] = 1 & a[2] = 2 & a[3] = 3);
assert(b[1] = 4 & b[2] = 0);
diff --git a/testsuite/runnable/binary_literal.elna b/testsuite/runnable/binary_literal.elna
index 0c2cbd9..6380f24 100644
--- a/testsuite/runnable/binary_literal.elna
+++ b/testsuite/runnable/binary_literal.elna
@@ -1,3 +1,4 @@
+program()
begin
assert(0b11 = 3u);
assert(0B011 = 3u)
diff --git a/testsuite/runnable/case_constant_label.elna b/testsuite/runnable/case_constant_label.elna
index 5d55e9f..2402bf7 100644
--- a/testsuite/runnable/case_constant_label.elna
+++ b/testsuite/runnable/case_constant_label.elna
@@ -4,6 +4,7 @@ var
x: Int := 2
matched: Bool := false
+program()
begin
case x of
1: assert(false)
diff --git a/testsuite/runnable/case_else.elna b/testsuite/runnable/case_else.elna
index dbec6df..b5ab3c0 100644
--- a/testsuite/runnable/case_else.elna
+++ b/testsuite/runnable/case_else.elna
@@ -2,6 +2,7 @@ var
x: Int := 5
matched: Bool := false
+program()
begin
case x of
1: assert(false)
diff --git a/testsuite/runnable/case_int.elna b/testsuite/runnable/case_int.elna
index 3b770a7..ca36fc8 100644
--- a/testsuite/runnable/case_int.elna
+++ b/testsuite/runnable/case_int.elna
@@ -1,6 +1,7 @@
var
x: Int := 2
+program()
begin
case x of
1: assert(false)
diff --git a/testsuite/runnable/case_multilabel.elna b/testsuite/runnable/case_multilabel.elna
index be647d4..083bdb0 100644
--- a/testsuite/runnable/case_multilabel.elna
+++ b/testsuite/runnable/case_multilabel.elna
@@ -1,6 +1,7 @@
var
x: Int := 3
+program()
begin
case x of
1, 2, 3: assert(true)
diff --git a/testsuite/runnable/case_record.elna b/testsuite/runnable/case_record.elna
index 4f65a5b..26436ea 100644
--- a/testsuite/runnable/case_record.elna
+++ b/testsuite/runnable/case_record.elna
@@ -7,6 +7,7 @@ type
var
r: R := R{a: 1, b: 2}
+program()
begin
case r of
R{a: 0, b: 0}: assert(false)
diff --git a/testsuite/runnable/compile_time_array_access.elna b/testsuite/runnable/compile_time_array_access.elna
index 4d59215..b854635 100644
--- a/testsuite/runnable/compile_time_array_access.elna
+++ b/testsuite/runnable/compile_time_array_access.elna
@@ -2,6 +2,7 @@ var
array: const [3]Int := [1, 2, 3]
i: const Int := array[2]
+program()
begin
assert(i = 2)
end.
diff --git a/testsuite/runnable/const_copy.elna b/testsuite/runnable/const_copy.elna
index 5982149..32cee67 100644
--- a/testsuite/runnable/const_copy.elna
+++ b/testsuite/runnable/const_copy.elna
@@ -7,6 +7,7 @@ begin
assert(y = 5)
return
+program()
begin
f()
end.
diff --git a/testsuite/runnable/const_initialization.elna b/testsuite/runnable/const_initialization.elna
index 7f922ff..56a6697 100644
--- a/testsuite/runnable/const_initialization.elna
+++ b/testsuite/runnable/const_initialization.elna
@@ -5,6 +5,7 @@ begin
assert(x = 5)
return
+program()
begin
f()
end.
diff --git a/testsuite/runnable/constant_string_initializer.elna b/testsuite/runnable/constant_string_initializer.elna
index 52ca429..8fd3b78 100644
--- a/testsuite/runnable/constant_string_initializer.elna
+++ b/testsuite/runnable/constant_string_initializer.elna
@@ -1,6 +1,7 @@
var
s: []const Word8 := "String value"
+program()
begin
assert(s = "String value")
end.
diff --git a/testsuite/runnable/define_multiple_local_variables.elna b/testsuite/runnable/define_multiple_local_variables.elna
index 8e44da4..72f0874 100644
--- a/testsuite/runnable/define_multiple_local_variables.elna
+++ b/testsuite/runnable/define_multiple_local_variables.elna
@@ -3,6 +3,7 @@ var
a, b: Int := 5
return a = 5 & b = 5
+program()
begin
assert(f())
end.
diff --git a/testsuite/runnable/exported_variable/sut.elna b/testsuite/runnable/exported_variable/sut.elna
index 52fb291..1fbc6ee 100644
--- a/testsuite/runnable/exported_variable/sut.elna
+++ b/testsuite/runnable/exported_variable/sut.elna
@@ -1,5 +1,6 @@
import helper
+program()
begin
assert(Shared = 42)
end.
diff --git a/testsuite/runnable/fixed_int_max.elna b/testsuite/runnable/fixed_int_max.elna
index 0564dd6..f00fd60 100644
--- a/testsuite/runnable/fixed_int_max.elna
+++ b/testsuite/runnable/fixed_int_max.elna
@@ -1,3 +1,4 @@
+program()
begin
assert(#max(Int8) = 127i8);
assert(#max(Int16) = 32767i16);
diff --git a/testsuite/runnable/fixed_int_min.elna b/testsuite/runnable/fixed_int_min.elna
index de83d1a..fd6b110 100644
--- a/testsuite/runnable/fixed_int_min.elna
+++ b/testsuite/runnable/fixed_int_min.elna
@@ -1,3 +1,4 @@
+program()
begin
assert(#min(Int8) = -128i8);
assert(#min(Int16) = -32768i16);
diff --git a/testsuite/runnable/fixed_word_max.elna b/testsuite/runnable/fixed_word_max.elna
index 76026a2..c657614 100644
--- a/testsuite/runnable/fixed_word_max.elna
+++ b/testsuite/runnable/fixed_word_max.elna
@@ -1,3 +1,4 @@
+program()
begin
assert(#max(Word8) = 255u8);
assert(#max(Word16) = 65535u16);
diff --git a/testsuite/runnable/float_arithmetic.elna b/testsuite/runnable/float_arithmetic.elna
index 73072f2..f792b04 100644
--- a/testsuite/runnable/float_arithmetic.elna
+++ b/testsuite/runnable/float_arithmetic.elna
@@ -1,3 +1,4 @@
+program()
begin
assert(6.0 / 2.0 = 3.0);
assert(5.0 / 2.0 = 2.5);
diff --git a/testsuite/runnable/for_each_array.elna b/testsuite/runnable/for_each_array.elna
index c6cba41..806a84b 100644
--- a/testsuite/runnable/for_each_array.elna
+++ b/testsuite/runnable/for_each_array.elna
@@ -3,6 +3,7 @@ var
input: [4]Word := [2u, 4u, 6u, 8u]
i: Word := 1u
+program()
begin
for element of input do
actual[i] := element^ * 2u;
diff --git a/testsuite/runnable/for_each_slice.elna b/testsuite/runnable/for_each_slice.elna
index 5356bc8..ecd3cc3 100644
--- a/testsuite/runnable/for_each_slice.elna
+++ b/testsuite/runnable/for_each_slice.elna
@@ -4,6 +4,7 @@ var
slice: []Word
i: Word := 1u
+program()
begin
slice := input[1u to input.length];
diff --git a/testsuite/runnable/for_with.elna b/testsuite/runnable/for_with.elna
index 22ccb13..582a641 100644
--- a/testsuite/runnable/for_with.elna
+++ b/testsuite/runnable/for_with.elna
@@ -1,6 +1,7 @@
var
actual: [3]Word := [0u, 0u, 0u]
+program()
begin
for element of [1u, 2u, 3u] with i do
actual[i] := i * element^
diff --git a/testsuite/runnable/generic_pointer_arithmetic.elna b/testsuite/runnable/generic_pointer_arithmetic.elna
index c737c7d..9aad7d6 100644
--- a/testsuite/runnable/generic_pointer_arithmetic.elna
+++ b/testsuite/runnable/generic_pointer_arithmetic.elna
@@ -4,6 +4,7 @@ var
first: Pointer
second: Pointer
+program()
begin
element := base.ptr;
first := element;
diff --git a/testsuite/runnable/hexadecimal_literal.elna b/testsuite/runnable/hexadecimal_literal.elna
index 71fd2da..a168bd2 100644
--- a/testsuite/runnable/hexadecimal_literal.elna
+++ b/testsuite/runnable/hexadecimal_literal.elna
@@ -1,3 +1,4 @@
+program()
begin
assert(0xff = 255u);
assert(0X0f = 15u)
diff --git a/testsuite/runnable/multi_module/sut.elna b/testsuite/runnable/multi_module/sut.elna
index fb26a26..666f82a 100644
--- a/testsuite/runnable/multi_module/sut.elna
+++ b/testsuite/runnable/multi_module/sut.elna
@@ -1,5 +1,6 @@
import helper
+program()
begin
assert(multiply(3, 4) = 12)
end.
diff --git a/testsuite/runnable/procedure_cast.elna b/testsuite/runnable/procedure_cast.elna
index ee97a6b..11e0e72 100644
--- a/testsuite/runnable/procedure_cast.elna
+++ b/testsuite/runnable/procedure_cast.elna
@@ -3,6 +3,7 @@ var cb: proc(x: ^Char) -> Int
proc probe_int(x: ^Int) -> Int
return 42
+program()
begin
cb := cast(probe_int: proc(x: ^Char) -> Int);
assert(cb(nil) = 42)
diff --git a/testsuite/runnable/record_base_assignment.elna b/testsuite/runnable/record_base_assignment.elna
index 2a15d0f..81ee7cf 100644
--- a/testsuite/runnable/record_base_assignment.elna
+++ b/testsuite/runnable/record_base_assignment.elna
@@ -16,6 +16,7 @@ begin
assert(r.x = 3u & r.y = 2u)
return
+program()
begin
f()
end.
diff --git a/testsuite/runnable/record_base_constructor.elna b/testsuite/runnable/record_base_constructor.elna
index 86da08a..1ca3214 100644
--- a/testsuite/runnable/record_base_constructor.elna
+++ b/testsuite/runnable/record_base_constructor.elna
@@ -12,6 +12,7 @@ type
var
g: Grandchild := Grandchild{a: 3, b: 5, c: 7}
+program()
begin
assert(g.a = 3);
assert(g.b = 5);
diff --git a/testsuite/runnable/record_construction.elna b/testsuite/runnable/record_construction.elna
index 2bbc493..31fc21f 100644
--- a/testsuite/runnable/record_construction.elna
+++ b/testsuite/runnable/record_construction.elna
@@ -6,6 +6,7 @@ type
var
r: R := R{x: 1, y: 2}
+program()
begin
assert(r.x = 1 & r.y = 2)
end.
diff --git a/testsuite/runnable/record_extension.elna b/testsuite/runnable/record_extension.elna
index 7d8dc61..b195759 100644
--- a/testsuite/runnable/record_extension.elna
+++ b/testsuite/runnable/record_extension.elna
@@ -10,6 +10,7 @@ var
token_memory: ElnaLexerStringToken
current_token: ^ElnaLexerToken
+program()
begin
current_token := @token_memory;
cast(current_token: ^ElnaLexerStringToken)^.value := "Some string";
diff --git a/testsuite/runnable/record_layout.elna b/testsuite/runnable/record_layout.elna
index 180d7bc..b94f18a 100644
--- a/testsuite/runnable/record_layout.elna
+++ b/testsuite/runnable/record_layout.elna
@@ -50,6 +50,7 @@ begin
assert(array_record_c_offset = 3u * int_size)
return
+program()
begin
f()
end.
diff --git a/testsuite/runnable/recursive_record.elna b/testsuite/runnable/recursive_record.elna
index 237eece..c940da9 100644
--- a/testsuite/runnable/recursive_record.elna
+++ b/testsuite/runnable/recursive_record.elna
@@ -27,6 +27,7 @@ begin
end;
return result
+program()
begin
first := malloc(#size(Node));
second := malloc(#size(Node));
diff --git a/testsuite/runnable/repeat_loop.elna b/testsuite/runnable/repeat_loop.elna
index 71554f0..ea50884 100644
--- a/testsuite/runnable/repeat_loop.elna
+++ b/testsuite/runnable/repeat_loop.elna
@@ -2,6 +2,7 @@ var
actual: [4]Word := [0u, 0u, 0u, 0u]
i: Word := 0u
+program()
begin
repeat
i := i + 1u;
diff --git a/testsuite/runnable/return_aggregate.elna b/testsuite/runnable/return_aggregate.elna
index fbc1a08..ad3ec65 100644
--- a/testsuite/runnable/return_aggregate.elna
+++ b/testsuite/runnable/return_aggregate.elna
@@ -7,6 +7,7 @@ type
proc f() -> R
return R{ a: 1, b: 2 }
+program()
begin
assert(f() = R{ a: 1, b: 2 })
end.
diff --git a/testsuite/runnable/slice_array.elna b/testsuite/runnable/slice_array.elna
index 8baaff3..2b747ea 100644
--- a/testsuite/runnable/slice_array.elna
+++ b/testsuite/runnable/slice_array.elna
@@ -2,6 +2,7 @@ var
array: [3]Int := [2, 4, 6]
slice: []Int
+program()
begin
slice := array[1 to 3];
diff --git a/testsuite/runnable/slice_cast.elna b/testsuite/runnable/slice_cast.elna
index ca093db..d11f80a 100644
--- a/testsuite/runnable/slice_cast.elna
+++ b/testsuite/runnable/slice_cast.elna
@@ -1,6 +1,7 @@
var
ints: [4]Int32 := [1i32, 2i32, 3i32, 4i32]
+program()
begin
assert(cast(ints[1u to 4u]: []Int8).length = #size(Int32) * ints.length)
end.
diff --git a/testsuite/runnable/slice_equality.elna b/testsuite/runnable/slice_equality.elna
index e34981a..08eb4f2 100644
--- a/testsuite/runnable/slice_equality.elna
+++ b/testsuite/runnable/slice_equality.elna
@@ -2,6 +2,7 @@ var
lhs_payload, rhs_payload: [3]Int := [2, 4, 6]
lhs, rhs: []Int
+program()
begin
lhs := lhs_payload[1 to 3];
rhs := rhs_payload[1 to 3];
diff --git a/testsuite/runnable/slice_pointer.elna b/testsuite/runnable/slice_pointer.elna
index 1ab367e..6ebcec9 100644
--- a/testsuite/runnable/slice_pointer.elna
+++ b/testsuite/runnable/slice_pointer.elna
@@ -2,6 +2,7 @@ var
array: [3]Int := [2, 4, 6]
slice: []Int
+program()
begin
slice := array.ptr[1 to 3];
diff --git a/testsuite/runnable/slice_slice.elna b/testsuite/runnable/slice_slice.elna
index f5e0eba..459cf51 100644
--- a/testsuite/runnable/slice_slice.elna
+++ b/testsuite/runnable/slice_slice.elna
@@ -2,6 +2,7 @@ var
array: [5]Int := [2, 4, 6, 8, 10]
slice1, slice2: []Int
+program()
begin
slice1 := array[1 to array.length];
slice2 := slice1[2 to 4];
diff --git a/testsuite/runnable/two_fields_same_type.elna b/testsuite/runnable/two_fields_same_type.elna
index 71dcbee..7d7292d 100644
--- a/testsuite/runnable/two_fields_same_type.elna
+++ b/testsuite/runnable/two_fields_same_type.elna
@@ -8,7 +8,7 @@ var
r: R := R{x: 3, y: 2}
return r.x + r.y
-
+program()
begin
assert(f() = 5)
end.
diff --git a/testsuite/runnable/two_parameters_same_type.elna b/testsuite/runnable/two_parameters_same_type.elna
index 105a40c..41d688c 100644
--- a/testsuite/runnable/two_parameters_same_type.elna
+++ b/testsuite/runnable/two_parameters_same_type.elna
@@ -1,6 +1,7 @@
proc f(x, y: Int) -> Int
return x + y
+program()
begin
assert(f(2, 3) = 5)
end.
diff --git a/testsuite/runnable/unary_plus.elna b/testsuite/runnable/unary_plus.elna
index bfd59d6..e4b3762 100644
--- a/testsuite/runnable/unary_plus.elna
+++ b/testsuite/runnable/unary_plus.elna
@@ -1,6 +1,7 @@
proc f(x: Int) -> Int
return +x
+program()
begin
assert(+3 = 3);
assert(f(5) = 5);
diff --git a/testsuite/runnable/unicode_escape_character.elna b/testsuite/runnable/unicode_escape_character.elna
index d49910c..0cfd3e2 100644
--- a/testsuite/runnable/unicode_escape_character.elna
+++ b/testsuite/runnable/unicode_escape_character.elna
@@ -1,3 +1,4 @@
+program()
begin
assert(`\{U+E9}` = `é`);
assert(`\{U+1F600}` = `😀`)
diff --git a/testsuite/runnable/unicode_escape_string.elna b/testsuite/runnable/unicode_escape_string.elna
index 5905eda..bec794a 100644
--- a/testsuite/runnable/unicode_escape_string.elna
+++ b/testsuite/runnable/unicode_escape_string.elna
@@ -1,3 +1,4 @@
+program()
begin
assert("caf\{U+E9}" = "café");
assert("Hi \{U+1F600}!" = "Hi 😀!")