Commit graph

415 commits

Author SHA1 Message Date
Daniel Kochmański
f5372b057d core: split cl_core_struct in two structure cl_core and ecl_core
ecl_core contains early global environment that is meant to be shared by all
runtimes, while cl_core contains an environment relevant to common lisp.
2026-03-07 21:35:37 +01:00
Marius Gerbershagen
fcddd9c175 compiler.d: fix order of evaluation bug for nested eval-when forms 2026-03-05 20:22:39 +01:00
Marius Gerbershagen
5053532ee1 avoid name clashes in some tests
The cmp.0077.make-load-form.circular-dep test already tried to avoid
name clashes using ext:with-clean-symbols but this is a bit
problematic to use with file compilation since it uses uninterned
symbols. Just adding a prefix avoids the issue in a simpler, more
robust way.
2026-03-05 20:22:39 +01:00
Daniel Kochmański
13d41b746a tests: add a new regression test for a bug found in the reader 2026-03-05 14:37:08 +01:00
Daniel Kochmański
8d9f3c171d tests: add a new mixed test for bignums 2026-03-04 14:29:30 +01:00
Daniel Kochmański
56f1ce7850 tests: add a regression test for a symbol parser bug 2026-03-04 14:29:30 +01:00
Daniel Kochmański
83fc257cfa tests: add a regression test for a readtable-case bug 2026-03-04 14:29:30 +01:00
Marius Gerbershagen
9b1b5bdcbe fix test
We are already working in a sandbox, no need to use /tmp.
2026-02-28 19:05:15 +01:00
Marius Gerbershagen
03a07d87b4 tests: fix Makefile for platforms that don't ship bash in /bin
Bug fix provided by Dima Pasechnik
2026-02-26 20:06:33 +01:00
Marius Gerbershagen
d4994b33f0 cmp: fix incorrect coercion of base strings to extended strings
The compiler was coercing base strings to extended strings when
encountering them as literal objects in compiled files. According to
CLHS 3.2.4.2.2, we need to preserve the actual element type (after
upgrading) of arrays during compilation. For ECL, the actual array
element type of a base-string is base-char and therefore we can't
change this to an extended string.

Actually fixing this requires some work since we use the reader to
store a printed representation of the string in the compiled file. The
reader string syntax always returns an extended string (There is a
comment in the code which claims that this is implied by CLHS 2.4.5. I
am not quite sure if that is really true but for backwards
compatibility I don't want to change this). We thus introduce a new
syntax #"..." for base strings which is used when reading objects from
compiled files. To prevent the new syntax from leaking outside of this
context, we also introduce a new readtable.
2026-02-14 20:36:49 +01:00
Marius Gerbershagen
c6488fa1c1 cmp: fix type propagator for EXPT
There were a number of bugs here:
- REAL was returned even for complex exponents
- The special case of exponent=0 wasn't handled correctly
- In some cases, EXPT could return integer or rational results but the
  type propagator would always assume that coercion to floating point
  was happening.
2025-12-13 19:51:53 +01:00
Marius Gerbershagen
f1091f4cd6 expt: fix floating point contagion
Examples of the bug

(expt -1.4d0 #C(1 2)) -> #C(-0.0020444484 -0.0016295447)
(expt #C(1.0 3.0) 0.0d0) -> #C(1.0 0.0)

These return a (complex single-float), should be (complex double-float).

The code incorrectly assumed that the numbers associated to the types
tx and ty were ordered such that long floats and complex long floats
have higher numbers than double floats and complex double floats.
2025-12-12 23:02:31 +01:00
Marius Gerbershagen
0baa1290e6 cmp: fix constant folding for target dependent constants
Register these constants as symbol macros in the lexical environment.
Maybe not the cleanest solution, but it works.
2025-11-22 16:25:42 +01:00
Marius Gerbershagen
e30c37691b tests: implement tests for cross compilation of user code
We start a remote ECL host and replace COMPILE-FILE and COMPILE by a
stub which shells out compile commands to this remote ECL. Moreover, a
few commands defining types, special variables and proclamations are
mirrored in the remote ECL as well. This of course is not a complete
synchronization mechanism and thus the state of the remote ECL will
not be 100% the same as that of the host which means that the COMPILE
stub is not an entirely correct implementation of the ANSI standard.
But it works well enough to run the test suite which is all we need.
2025-11-21 19:08:14 +01:00
Daniel Kochmański
1e10761593 tests: add a test for the recent regression 2025-11-16 11:03:48 +01:00
Daniel Kochmański
c33c8f2ef7 tests: add a test for failed conversion byte->char
Sometimes bytes are outside of the character range. In that case we should
signal an error when we try to read them.
2025-08-11 10:01:41 +02:00
Daniel Kochmański
c7d78a412e tests: add tests for bivalent streams based on sequences 2025-08-11 10:01:40 +02:00
Daniel Kochmański
5fe96b8339 tests: add sequence stream tests for new functionality
- ensure that all byte element types are handled by binary sequence streams
- ensure that the vector fill pointer is followed by the input sequence
2025-08-11 10:01:40 +02:00
Daniel Kochmański
7ee0977a50 tests: add test for binary and bivalent streams with extensions
Tests reading, peeking and unreading both characters and bytes.
2025-08-11 10:01:37 +02:00
Daniel Kochmański
a887d040a2 tests: add a new test suite "stream"
Currently it contains only a check for a recently fixed bug in:
streams: fix a braino in str_in_unread_char
2025-08-11 10:01:37 +02:00
Daniel Kochmański
a916a5ccff tests: make finishes return the values from the executed form 2025-08-11 10:01:37 +02:00
Marius Gerbershagen
b0f7711bd1 tests: fix process-environ
We were trying to check if the output of the program is empty but we
were passing `:output nil` to ext:run-program. Thus, the stream from
which we trying to read was nil which is the stream designator for the
standard input. The empty read succeeded only by chance if the
standard input had no available characters to read.
2025-06-28 19:45:50 +02:00
Daniel Kochmański
0857a438f6 logical pathnames: add a regression test and update the changelog
I've tested it against ansi-test and our own test suite and there are no
regressions.

Related to #784.
2025-06-26 14:31:07 +02:00
Daniel Kochmański
92978b6cae tests: add a test for the recent regression in bytecmp
The regression happens when we pass compiler env from ccmp to bcmp.
2025-05-27 14:02:28 +02:00
Daniel Kochmański
c0720610dd tests: add missing imports and tweak mix.0010.file-stream-fd
We didn't export *TEST-NAME*, FAILED and TEST-FAILURE from 2am-ecl, so the macro
FAIL did not work correctly.

The test mix.0010.file-stream-fd contained a safeguard for a bug from 2016, no
need to guard against that today.
2025-05-23 08:15:00 +02:00
Daniel Kochmański
1b5a03ffca tests: disable a test on bytecmp that uses compiler-cc 2025-05-09 13:55:59 +02:00
Daniel Kochmański
aefcd77e02 tests: add a regression test for an encountered issue
This issue was never manifestable in develop branch.
2025-05-09 13:55:59 +02:00
Marius Gerbershagen
72c83ac9b5 cmp: fix bug for calls to local functions with more arguments than c-arguments-limits
Closes #774.
2025-04-05 22:14:17 +02:00
Daniel Kochmański
c9c5323578 tests: add a test for an important corner case
In case that someone wants to store the definition when compiling the file, we
need to make sure that the compiler does not error if it has unreadable objects.
2025-03-27 22:45:34 +01:00
Daniel Kochmański
f56b2b9192 tests: add tests for local macros closing over each other 2025-03-27 22:45:34 +01:00
Daniel Kochmański
4e95ee830a tests: add a failing test for minimal closures 2025-03-27 22:45:34 +01:00
Daniel Kochmański
9161bd427e tests: add a regression test for a newly spotted bug in bytecmp 2025-03-27 22:45:34 +01:00
Daniel Kochmański
63f0ba1ab8 tests: add regression tests for weak hash tables
See #761 and #762.
2024-11-01 08:46:33 +01:00
Daniel Kochmański
9f184db224 tests: add a regression test for #742. 2024-05-12 18:32:03 +02:00
Daniel Kochmański
d83c0f07cf Merge branch 'master' into develop 2024-05-10 13:40:20 +02:00
Tarn W. Burton
e439bb5fdd
Add test for buffer overun in encoding buffer 2024-05-10 06:38:21 -04:00
Daniel Kochmański
089f4c25d8 tests: make ansi-test a separate target not triggered by make check 2024-03-10 14:48:12 +01:00
Tarn W. Burton
33ffa5e53c Add ansi-test to tests 2024-03-10 14:48:12 +01:00
Tarn W. Burton
b797070f5f Add tests for Gray read-line 2024-03-10 14:48:12 +01:00
Daniel Kochmański
00f96d34b0 tests: make ansi-test a separate target not triggered by make check 2024-01-26 12:06:19 +01:00
Daniel Kochmański
e851458058 Merge branch 'type-check-init-forms' into 'develop'
cmp: check that the type of init-forms for optional and keyword arguments matches their proclaimed types

See merge request embeddable-common-lisp/ecl!316
2024-01-26 08:14:20 +00:00
Tarn W. Burton
417cf25bc4
Add ansi-test to tests 2024-01-14 13:30:49 -05:00
Marius Gerbershagen
561b09a8ce cmp: check that the type of init-forms for optional and keyword arguments matches their proclaimed types
For now, we only check constant init forms where we can do the check
at compile time.
2023-12-30 18:41:15 +01:00
Tarn W. Burton
ac0f992296
Add tests for Gray read-line 2023-12-04 15:23:38 -05:00
Daniel Kochmański
2414e829cc tests: cmp: add regression tests for this branch 2023-11-17 11:21:21 +01:00
Daniel Kochmański
02d6bdb0d3 tests: add a regression test for a bug encountered in this branch 2023-09-25 13:13:27 +02:00
Daniel Kochmański
7ea81cf0cd tests: replace an idiom (compile nil '(lambda ..)) -> (cmplambda ..)
This makes code easier to read because of less nesting.
2023-09-15 10:21:06 +02:00
Daniel Kochmański
26efdffb8d tests: add a regression test for compiled multiple-value-call 2023-09-15 10:19:21 +02:00
Marius Gerbershagen
0b5ea3868d tests: move interrupt tests to stress test suite
These tests are not guaranteed to succeed but are still useful
to check for regressions for those configurations for which
thread synchronization primitives are interrupt safe.
2023-08-13 22:26:53 +02:00
Marius Gerbershagen
389e89d4d7 tests: add missing #+unicode in run-program-encoding 2023-08-03 15:21:08 +02:00