diff options
Diffstat (limited to 'testsuite')
| -rw-r--r-- | testsuite/compilable/const_pointer_conversion.elna | 14 | ||||
| -rw-r--r-- | testsuite/fail_compilation/assign_const_to_pointer.elna | 7 | ||||
| -rw-r--r-- | testsuite/fail_compilation/assign_from_const_pointer.elna | 7 |
3 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/compilable/const_pointer_conversion.elna b/testsuite/compilable/const_pointer_conversion.elna new file mode 100644 index 0000000..003fbea --- /dev/null +++ b/testsuite/compilable/const_pointer_conversion.elna @@ -0,0 +1,14 @@ +var + x: Int + c: const Int + p: ^Int + pc: ^const Int + v: Pointer + cv: const Pointer := nil + cv2: const Pointer := @x + cv3: const Pointer := @c + +begin + v := p; + v := @x +end. diff --git a/testsuite/fail_compilation/assign_const_to_pointer.elna b/testsuite/fail_compilation/assign_const_to_pointer.elna new file mode 100644 index 0000000..c3d9230 --- /dev/null +++ b/testsuite/fail_compilation/assign_const_to_pointer.elna @@ -0,0 +1,7 @@ +var + c: const Int + p: Pointer + +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 new file mode 100644 index 0000000..164bb42 --- /dev/null +++ b/testsuite/fail_compilation/assign_from_const_pointer.elna @@ -0,0 +1,7 @@ +var + cv: const Pointer + p: Pointer + +begin + p := cv (* @Error Expected type 'Pointer', but got 'const Pointer' *) +end. |
