diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-09-24 00:39:51 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-09-24 00:39:51 +0200 |
| commit | f7b035a505e86ad916a43ab1dc1a662a6066b011 (patch) | |
| tree | a54369ae8ad56352d148c4583ab568f7d4869d30 /testsuite/compilable | |
| parent | 74e75e41fe12f19e5365a3152ffafa1a29376240 (diff) | |
| download | elna-f7b035a505e86ad916a43ab1dc1a662a6066b011.tar.gz | |
Move module heading to the top
Diffstat (limited to 'testsuite/compilable')
29 files changed, 49 insertions, 39 deletions
diff --git a/testsuite/compilable/aliased_type_constant.elna b/testsuite/compilable/aliased_type_constant.elna index 16a52c2..e4054c7 100644 --- a/testsuite/compilable/aliased_type_constant.elna +++ b/testsuite/compilable/aliased_type_constant.elna @@ -1,3 +1,5 @@ +module + type Handle = Int diff --git a/testsuite/compilable/assign_record_to_base.elna b/testsuite/compilable/assign_record_to_base.elna index 303bde0..14bc3f5 100644 --- a/testsuite/compilable/assign_record_to_base.elna +++ b/testsuite/compilable/assign_record_to_base.elna @@ -1,3 +1,4 @@ +program() type B = record x: Int @@ -10,9 +11,6 @@ var x: ^B := nil y: ^R := nil -program() begin - x := y; -return 0u8 - + x := y end. diff --git a/testsuite/compilable/compile_time_array_length.elna b/testsuite/compilable/compile_time_array_length.elna index e38919e..9e2c896 100644 --- a/testsuite/compilable/compile_time_array_length.elna +++ b/testsuite/compilable/compile_time_array_length.elna @@ -1,3 +1,5 @@ +module + var source: const [3]Int := [1, 2, 3] target: Word := source.length diff --git a/testsuite/compilable/const_alias.elna b/testsuite/compilable/const_alias.elna index 3a6b365..e4b6434 100644 --- a/testsuite/compilable/const_alias.elna +++ b/testsuite/compilable/const_alias.elna @@ -1,3 +1,5 @@ +module + type CI = const Int CCI = const CI diff --git a/testsuite/compilable/const_element_array.elna b/testsuite/compilable/const_element_array.elna index 2d68ff5..d6419fa 100644 --- a/testsuite/compilable/const_element_array.elna +++ b/testsuite/compilable/const_element_array.elna @@ -1,3 +1,5 @@ +module + type CI = const Int diff --git a/testsuite/compilable/const_extern.elna b/testsuite/compilable/const_extern.elna index 9e8fbb0..6f4b058 100644 --- a/testsuite/compilable/const_extern.elna +++ b/testsuite/compilable/const_extern.elna @@ -1,3 +1,5 @@ +module + var errno_like: const Int := extern diff --git a/testsuite/compilable/const_negation.elna b/testsuite/compilable/const_negation.elna index 82a4cb6..1dd45f4 100644 --- a/testsuite/compilable/const_negation.elna +++ b/testsuite/compilable/const_negation.elna @@ -1,11 +1,9 @@ +program() var x: const Int := -5 y: const Int := -x -program() begin assert(x = -5); assert(y = 5); -return 0u8 - end. diff --git a/testsuite/compilable/const_var_chain.elna b/testsuite/compilable/const_var_chain.elna index ad85f48..438b79a 100644 --- a/testsuite/compilable/const_var_chain.elna +++ b/testsuite/compilable/const_var_chain.elna @@ -1,10 +1,8 @@ +program() var x: const Int := 42 y: Int := x -program() begin assert(y = 42) -return 0u8 - end. diff --git a/testsuite/compilable/double_literals.elna b/testsuite/compilable/double_literals.elna index 9e8a73d..2f2bcdd 100644 --- a/testsuite/compilable/double_literals.elna +++ b/testsuite/compilable/double_literals.elna @@ -1,3 +1,5 @@ +module + proc f() var x: const Double := 3.14 diff --git a/testsuite/compilable/empty_proc.elna b/testsuite/compilable/empty_proc.elna index bf3bd84..d08593b 100644 --- a/testsuite/compilable/empty_proc.elna +++ b/testsuite/compilable/empty_proc.elna @@ -1,3 +1,5 @@ +module + proc f() return diff --git a/testsuite/compilable/empty_proc_type_expression.elna b/testsuite/compilable/empty_proc_type_expression.elna index 7738cae..f9c0819 100644 --- a/testsuite/compilable/empty_proc_type_expression.elna +++ b/testsuite/compilable/empty_proc_type_expression.elna @@ -1,3 +1,5 @@ +module + type P = proc() diff --git a/testsuite/compilable/empty_statements_in_a_row.elna b/testsuite/compilable/empty_statements_in_a_row.elna index 7cf723c..465ab19 100644 --- a/testsuite/compilable/empty_statements_in_a_row.elna +++ b/testsuite/compilable/empty_statements_in_a_row.elna @@ -1,3 +1,5 @@ +module + proc f() begin ; diff --git a/testsuite/compilable/generic_alias.elna b/testsuite/compilable/generic_alias.elna index 3b431be..47ac638 100644 --- a/testsuite/compilable/generic_alias.elna +++ b/testsuite/compilable/generic_alias.elna @@ -1,3 +1,4 @@ +program() type File = record fd: Int @@ -20,12 +21,9 @@ var raw: ^^File boxed: Boxed#[^File] -program() begin chain.next := nil; aliased := raw; raw := aliased; boxed.inner := @chain -return 0u8 - end. diff --git a/testsuite/compilable/generic_arguments.elna b/testsuite/compilable/generic_arguments.elna index 6bc5242..4d33db5 100644 --- a/testsuite/compilable/generic_arguments.elna +++ b/testsuite/compilable/generic_arguments.elna @@ -1,3 +1,4 @@ +program() type File = record fd: Int @@ -11,18 +12,15 @@ type var entry: Pair#[^File, ^Word8] -proc allocate#[T](size: Word) -> T extern +proc allocate#[T](size: Word) -> T +extern proc first#[K, V](entry_ptr: ^Pair#[K, V]) -> K -begin return entry_ptr^.key -program() begin entry.key := allocate#[^File](#size(File)); assert(#size(Pair#[^File, ^Word8]) = #size(Pointer) * 2u); assert(#offset(Pair#[^File, ^Word8], value) = #size(Pointer)); assert(first#[^File, ^Word8](@entry) = entry.key) -return 0u8 - end. diff --git a/testsuite/compilable/generic_base_chain.elna b/testsuite/compilable/generic_base_chain.elna index 736042b..c303e6d 100644 --- a/testsuite/compilable/generic_base_chain.elna +++ b/testsuite/compilable/generic_base_chain.elna @@ -1,3 +1,4 @@ +program() type File = record fd: Int @@ -22,10 +23,7 @@ begin target^.key := key return -program() begin upcast := @store; put(@store, byte_key) -return 0u8 - end. diff --git a/testsuite/compilable/generic_inference.elna b/testsuite/compilable/generic_inference.elna index 25faca4..ab1ff3a 100644 --- a/testsuite/compilable/generic_inference.elna +++ b/testsuite/compilable/generic_inference.elna @@ -1,3 +1,4 @@ +program() type File = record fd: Int @@ -23,11 +24,8 @@ begin store(target, value) return -program() begin store(@files, @f); relay(@bytes, @b); store(@files, nil) -return 0u8 - end. diff --git a/testsuite/compilable/opaque_type.elna b/testsuite/compilable/opaque_type.elna index c570e0d..6474337 100644 --- a/testsuite/compilable/opaque_type.elna +++ b/testsuite/compilable/opaque_type.elna @@ -1,3 +1,4 @@ +program() type Handle = extern Alias = Handle @@ -9,9 +10,6 @@ var proc take(h: ^Handle) -> ^Handle return h -program() begin alias := take(handle) -return 0u8 - end. diff --git a/testsuite/compilable/pointer_cast.elna b/testsuite/compilable/pointer_cast.elna index ad15432..2b986c0 100644 --- a/testsuite/compilable/pointer_cast.elna +++ b/testsuite/compilable/pointer_cast.elna @@ -1,11 +1,9 @@ +program() var c: ^Char := nil p: Pointer := nil -program() begin p := c; c := p -return 0u8 - end. diff --git a/testsuite/compilable/pointer_const_conversion.elna b/testsuite/compilable/pointer_const_conversion.elna index a5bd297..c08862b 100644 --- a/testsuite/compilable/pointer_const_conversion.elna +++ b/testsuite/compilable/pointer_const_conversion.elna @@ -1,10 +1,8 @@ +program() var x: Int p: ^const Int -program() begin p := @x -return 0u8 - end. diff --git a/testsuite/compilable/pointer_subtraction.elna b/testsuite/compilable/pointer_subtraction.elna index 8dd1ff6..738845d 100644 --- a/testsuite/compilable/pointer_subtraction.elna +++ b/testsuite/compilable/pointer_subtraction.elna @@ -1,3 +1,5 @@ +module + proc test(a, b: ^Char) -> Int return a - b diff --git a/testsuite/compilable/procedure_forward_reference.elna b/testsuite/compilable/procedure_forward_reference.elna index cdf3008..0e6f93c 100644 --- a/testsuite/compilable/procedure_forward_reference.elna +++ b/testsuite/compilable/procedure_forward_reference.elna @@ -1,3 +1,5 @@ +module + proc first() -> Int return second() + 1 diff --git a/testsuite/compilable/record_const_base.elna b/testsuite/compilable/record_const_base.elna index f24d27b..a4c6b7b 100644 --- a/testsuite/compilable/record_const_base.elna +++ b/testsuite/compilable/record_const_base.elna @@ -1,3 +1,5 @@ +module + type B = record x: Int diff --git a/testsuite/compilable/self-referencing-record.elna b/testsuite/compilable/self-referencing-record.elna index 311f148..d340492 100644 --- a/testsuite/compilable/self-referencing-record.elna +++ b/testsuite/compilable/self-referencing-record.elna @@ -1,3 +1,5 @@ +module + type R = record field: ^R diff --git a/testsuite/compilable/semicolon_parameter_separator.elna b/testsuite/compilable/semicolon_parameter_separator.elna index 229fde0..c998606 100644 --- a/testsuite/compilable/semicolon_parameter_separator.elna +++ b/testsuite/compilable/semicolon_parameter_separator.elna @@ -1,3 +1,5 @@ +module + proc f(a: Int; b: Word) return diff --git a/testsuite/compilable/single_literals.elna b/testsuite/compilable/single_literals.elna index ac03623..a18d2ca 100644 --- a/testsuite/compilable/single_literals.elna +++ b/testsuite/compilable/single_literals.elna @@ -1,3 +1,5 @@ +module + proc f() var x: const Single := 3.14f diff --git a/testsuite/compilable/slice_index.elna b/testsuite/compilable/slice_index.elna index 70d26ae..13121eb 100644 --- a/testsuite/compilable/slice_index.elna +++ b/testsuite/compilable/slice_index.elna @@ -1,3 +1,5 @@ +module + proc f() var a: []Int diff --git a/testsuite/compilable/take_const_address.elna b/testsuite/compilable/take_const_address.elna index 4f82b2a..a60b1c2 100644 --- a/testsuite/compilable/take_const_address.elna +++ b/testsuite/compilable/take_const_address.elna @@ -1,10 +1,8 @@ +program() var x: ^const Int y: const Int := 1 -program() begin x := @y -return 0u8 - end. diff --git a/testsuite/compilable/trailing_text.elna b/testsuite/compilable/trailing_text.elna index 1eb3595..0a95516 100644 --- a/testsuite/compilable/trailing_text.elna +++ b/testsuite/compilable/trailing_text.elna @@ -1,3 +1,5 @@ +module + end. Everything after the module terminator is ignored and is never scanned, so it diff --git a/testsuite/compilable/traits_size.elna b/testsuite/compilable/traits_size.elna index f245637..ad49b61 100644 --- a/testsuite/compilable/traits_size.elna +++ b/testsuite/compilable/traits_size.elna @@ -1,3 +1,4 @@ +program() var i: Int := 1 s: Int := cast(#size(Int): Int) @@ -5,11 +6,8 @@ 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)); assert(p > 0) -return 0u8 - end. |
