diff options
| author | Eugen Wissner <belka@caraus.de> | 2026-08-31 17:18:39 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2026-08-31 17:18:39 +0200 |
| commit | 0f5e9f00b07606871a6289060fa904555d41ae7d (patch) | |
| tree | 2699d0c10e5e1756bec8f6093796c7379ff95822 /testsuite/runnable | |
| parent | d905e48d6af0445c7941cd2e638461db2f4d9ee8 (diff) | |
| download | elna-0f5e9f00b07606871a6289060fa904555d41ae7d.tar.gz | |
Reject comparison of uncompatible types
Diffstat (limited to 'testsuite/runnable')
| -rw-r--r-- | testsuite/runnable/case_constant_label.elna | 13 | ||||
| -rw-r--r-- | testsuite/runnable/exported_variable/helper.elna | 4 | ||||
| -rw-r--r-- | testsuite/runnable/exported_variable/sut.elna | 5 | ||||
| -rw-r--r-- | testsuite/runnable/generic_pointer_arithmetic.elna | 13 |
4 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/runnable/case_constant_label.elna b/testsuite/runnable/case_constant_label.elna new file mode 100644 index 0000000..5d55e9f --- /dev/null +++ b/testsuite/runnable/case_constant_label.elna @@ -0,0 +1,13 @@ +var + base: const Int := 2 + limit: const Int := base + x: Int := 2 + matched: Bool := false + +begin + case x of + 1: assert(false) + | limit: matched := true + end; + assert(matched) +end. diff --git a/testsuite/runnable/exported_variable/helper.elna b/testsuite/runnable/exported_variable/helper.elna new file mode 100644 index 0000000..23924be --- /dev/null +++ b/testsuite/runnable/exported_variable/helper.elna @@ -0,0 +1,4 @@ +var + Shared*: Int := 42 + +end. diff --git a/testsuite/runnable/exported_variable/sut.elna b/testsuite/runnable/exported_variable/sut.elna new file mode 100644 index 0000000..52fb291 --- /dev/null +++ b/testsuite/runnable/exported_variable/sut.elna @@ -0,0 +1,5 @@ +import helper + +begin + assert(Shared = 42) +end. diff --git a/testsuite/runnable/generic_pointer_arithmetic.elna b/testsuite/runnable/generic_pointer_arithmetic.elna new file mode 100644 index 0000000..c737c7d --- /dev/null +++ b/testsuite/runnable/generic_pointer_arithmetic.elna @@ -0,0 +1,13 @@ +var + base: [4]Int + element: ^Int + first: Pointer + second: Pointer + +begin + element := base.ptr; + first := element; + second := first + 1; + assert(cast(second : Word) - cast(first : Word) = 1u); + assert(second - 1 = first) +end. |
