Commit graph

388 commits

Author SHA1 Message Date
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
Marius Gerbershagen
337606a07c tests: be more precise with signed vs. unsigned char
We give values between 0 and 255, so the character arrays have to be
unsigned but we are interpreting them as ordinary char arrays
later (which may be signed), so we have to put in an explicit cast.
2023-08-01 16:38:26 +02:00
Marius Gerbershagen
33aca4a57b cmp: don't output invalid C code if dead code elimination fails 2023-06-24 19:07:10 +02:00
Marius Gerbershagen
639d5f3ad3 cmp: fix errors in handling compound function types
These are valid in type declarations but must not be passed on as
arguments to typep.

Moreover, we were sometimes incorrectly simplifying code like

(typep x (function ...))

to (functionp x) in the native compiler.
2023-06-18 13:08:12 +02:00
Marius Gerbershagen
8586876051 tests: multiprocessing: increase timeout value in semaphore smoke tests
This makes the test run more reliably on slow computers.
2023-03-18 16:41:41 +01:00
Marius Gerbershagen
6845a9a480 Merge branch 'external-processes-encoding' into 'develop'
Some improvements for ext:run-program

Closes #607

See merge request embeddable-common-lisp/ecl!287
2023-03-12 14:31:39 +00:00
Daniel Kochmański
f160a6e07e tests: run-program: don't call terminate-process excessively
Calling terminate-process on a process that has already finished has undefined
consequences.
2023-03-07 17:10:16 +01:00
Marius Gerbershagen
dd29e35966 tests: 2am: if (finishes) fails due to a signal, print the error 2023-02-26 17:05:12 +01:00
Marius Gerbershagen
828b2b482a tests: run-program: fix terminate-process test on Windows 2023-02-26 17:05:12 +01:00
Marius Gerbershagen
c52ec9fe9e tests: implement process-environ test on windows 2023-02-26 17:03:09 +01:00
Marius Gerbershagen
02ef05479c ext:run-program: support unicode characters for the process name, arguments and environment
The encoding is determined by ext:*default-external-format* as usual.
2023-02-26 17:03:09 +01:00
Tarn W. Burton
cacf6a0ee9 Add test for NIL forms in FORMAT 2023-02-20 15:08:39 -05:00
Marius Gerbershagen
de89593216 fix typos 2023-02-18 17:30:30 +01:00
Marius Gerbershagen
357c860f1a tests: actually run clos tests and fix one of the tests 2023-02-16 20:03:39 +01:00
Daniel Kochmański
feff551c31 Merge branch 'inline-closure-global' into 'develop'
Fix compiler bug regarding inlining for global functions that are closures

See merge request embeddable-common-lisp/ecl!280
2023-02-14 21:05:19 +00:00
Marius Gerbershagen
d34fe2c065 Merge branch 'fix-listen' into develop 2023-02-05 19:45:58 +01:00
Daniel Kochmański
3064bac62b tests: add regression tests for define-method-combination 2023-01-22 20:36:07 +01:00
Tarn W. Burton
a495b04301 Add regression test for LISTEN on files 2023-01-16 10:46:24 -05:00
Tarn W. Burton
ca6d6e10d5 Add tests for illegal format directive parameters 2023-01-06 11:21:55 -05:00
Marius Gerbershagen
cd6f0894d2 numbers/log.d: more fixes for loss of precision in log
The problem encountered in 3f64e2e88b
affects not only the case of a logarithm where one argument is a
rational and the other a long or double float, but also cases where
both arguments are floating point numbers of different lengths.
2023-01-02 17:04:38 +01:00
Marius Gerbershagen
3f64e2e88b numbers/log.d: prevent unnecessary loss of precision
For (log x y) where one of the two arguments is a double or long float
and the other a rational number, defining (log x y) as (/ (log y) (log
x)) is imprecise since intermediate single float results will be used
for the rational argument. Prevent this by computing the logarithm of
the rational to the same precision as that of the other argument.

Fixes #688.
2023-01-02 16:37:45 +01:00
Marius Gerbershagen
2739ab7269 numbers/log.d: simplify implementation
- directly construct the complex result for negative real numbers
  instead of calling ecl_log1_complex_inner(x, ecl_make_fixnum(0))
- get rid of unnecessary double calls to ecl_to_float in ecl_log1_simple
- prevent floating point overflow for negative bignums in the same way
  as for positive ones
2023-01-02 16:32:04 +01:00
Marius Gerbershagen
fdcf5e7eff cmp: disable inlining for global functions that are closures
For functions already compiled and loaded, we simply check if the
definition is a closure. For functions defined in the same file, we
don't store their definition in the compiler environment but instead
use *global-funs*. The advantage is that this directly allows us to
determine whether a function is a closure or not and we don't have to
run the first compiler pass again each time we inline the function.

This commit also fixes some minor issues with the inline policy,
described in detail as follows:

1. The inline policy differed subtly between `proclaim` and `declaim`.
If a file like

(eval-when (:compile-toplevel)
  (proclaim '(inline f)))
(defun f ...)

was compiled (but not loaded), subsequent compilations would inline
`f` but for

(declaim (inline f))
(defun f ...)

the function `f` would only get inlined if the file was compiled _and_
loaded. We now use the latter approach for both cases. Thus, calling
`compile-file` without `load` has no side-effects regarding whether
functions are inlined or not.

2. We did not distinguish between functions which were declared inline
at a global versus local level such that e.g. in

(locally
    (declare (inline f))
  (defun f ...))

the function f would get inlined outside the scope of the `locally`
form. This is changed now such that local inline declarations only
apply to the scope in which they are made.

3. Inline declarations were made by expanding into statements like

(eval-when (:compile-toplevel)
  (c::declare-inline ...))

during the macroexpansion of `defun`. However this only works if the
`defun` appears at the toplevel and hence in code like

(declaim (inline f))
(let (...)
  (defun f ...))

the function `f` could not get inlined later on in the same file. This
is fixed now by calling the code which should run during compilation
directly when macro expanding defun.
2022-12-30 16:14:53 +01:00
Daniel Kochmański
93fabac00a cosmetic: use ECL_NIL instead of a deprecated constant Cnil 2022-11-24 18:55:25 +01:00
Daniel Kochmański
06e553157c tests: add a regression test for (log small-ratio) 2022-11-16 00:31:26 +01:00
Daniel Kochmański
3b4c4f3c98 tests: add a regression test for decode-float
Cases are hand picked.
2022-10-22 19:31:55 +02:00
Marius Gerbershagen
482d09ed10 format.lsp: fix incorrect roundings for ~e directive
Due to rounding issues the exponent can be different than what we
guessed. For example in the following only one digit should appear
before the decimal point such that

(format nil "~,1e" 9.9) => 9.9e+0

is correct but

(format nil "~,1e" 9.9) => 10.0e+0

is incorrect, has to be 1.0e+1.
2022-09-24 21:04:43 +02:00
Marius Gerbershagen
3db6ad91ff cmp: fix infinite loop for files containing lists with the same circular structure
Closes #630.
2022-08-14 17:17:57 +02:00