23 Commits

Author SHA1 Message Date
Trevor Gross
f0b932e723 Rework the available Cargo profiles
Currently the default release profile enables LTO and single CGU builds,
which is very slow to build. Most tests are better run with
optimizations enabled since it allows testing a much larger number of
inputs, so it is inconvenient that building can sometimes take
significantly longer than the tests.

Remedy this by doing the following:

* Move the existing `release` profile to `release-opt`.
* With the above, the default `release` profile is untouched (16 CGUs
  and thin local LTO).
* `release-checked` inherits `release`, so no LTO or single CGU.

This means that the simple `cargo test --release` becomes much faster
for local development. We are able to enable the other profiles as
needed in CI.

Tests should ideally still be run with `--profile release-checked` to
ensure there are no debug assetions or unexpected wrapping math hit.

`no-panic` still needs a single CGU, so must be run with `--profile
release-opt`. Since it is not possible to detect CGU or profilel
configuration from within build scripts, the `ENSURE_NO_PANIC`
environment variable must now always be set.
2025-01-25 07:38:15 +00:00
Trevor Gross
4a98907b8a Remove remnants of the checked feature
The Cargo feature `checked` was added in 410b0633a6b9 ("Overhaul tests")
and later removed in e4ac1399062c ("swap stable to be unstable, checked
is now debug_assertions"). However, there are a few remaining uses of
`feature = "checked"` that did not get removed. Clean these up here.
2025-01-25 04:18:44 +00:00
Trevor Gross
5c94cce6b2 Add a release-checked profile with debug and overflow assertions
A failing debug assertion or overflow without correctly wrapping or
saturating is a bug, but the `debug` profile that has these enabled does
not run enough test cases to hit edge cases that may trigger these. Add
a new `release-checked` profile that enables debug assertions and
overflow checks. This seems to only extend per-function test time by a
few seconds (or around a minute on longer extensive tests), so enable
this as the default on CI.

In order to ensure `no_panic` still gets checked, add a build-only step
to CI.
2025-01-11 20:35:30 -05:00
Trevor Gross
f2e16b6ac1 Add f16 and f128 configuration from compiler-builtins
In preparation of adding routines from these two types, duplicate the
`compiler-builtins` configuration here.
2024-12-29 02:33:41 -05:00
Trevor Gross
6d1033e7fc Add an "arch" Cargo feature that is on by default
Introduce a Cargo feature to enable or disable architecture-specific
features (SIMD, assembly), which is on by default. This allows for more
fine grained control compared to relying on the `force-soft-floats`
feature.

Similar to "unstable-intrinsics", introduce a build.rs config option for
`unstable-intrinsics AND NOT force-soft-floats`, which makes this easier
to work with in code.

Effectively, this allows moving our non-additive Cargo feature
(force-soft-floats) to a positive one by default, allowing for an
override when needed.
2024-10-28 22:12:13 -05:00
Trevor Gross
e6f7053c2e Replace feature = "unstable-intrinsics" with intrinsics_enabled
We currently have a non-additive feature, "force-soft-floats", and we
will need to gain another "no-f16-f128". This makes `cfg` usage in code
somewhat confusing and redundant.

Use `build.rs` to figure out if "unstable-intrinsics" is enabled while
"force-soft-floats" is not enabled and if so, emit a cfg
`intrinsics_enabled`. This is cleaner to use and should make adding more
features easier to reason about.

Also use this as an opportunity to eliminate the build.rs from the
compiler-builtins test crate, replaced with the `[lints]` table in
Cargo.toml.
2024-10-28 18:37:09 -05:00
Trevor Gross
3180b04aa3 Change build.rs to use the older : rather than ::
This allows supporting Rust < 1.77.
2024-10-27 22:46:17 -05:00
Trevor Gross
f59dd82cca Move musl-reference-tests to a new libm-test crate
There isn't any reason for this feature to be exposed or part of the
build script. Move it to a separate crate.

We will also want more tests that require some support functions; this
will create a place for them.
2024-10-05 15:54:39 -05:00
Trevor Gross
c7eadedd5f Deny warnings in CI
The main crate already has `#![deny(warnings)]`. Set RUSTFLAGS in CI to
enforce this for other crates in the workspace.
2024-05-06 04:51:41 -05:00
Amanieu d'Antras
eb26f75f63 Disable musl tests on powerpc64 2022-01-04 00:09:07 +01:00
Amanieu d'Antras
54a57001f8 Ignore some functions which don't match musl 2022-01-03 20:34:47 +01:00
Andrey Zgarbul
0dff1621e0 fix jn, ilogb 2019-05-09 18:40:19 +03:00
Alex Crichton
8a74ccde21 Test jn and jnf 2019-05-09 07:58:57 -07:00
Alex Crichton
fba10c51e6 Generate NaN and Infinity more often
Make sure they come up in RNG generation of floats
2019-05-09 07:53:21 -07:00
Alex Crichton
f3e2ed67f9 Test sincos and sincosf 2019-05-09 07:52:52 -07:00
Alex Crichton
13981db1e1 Move non-public functions to pub(crate)
Remove exceptions from the test list after doing so
2019-05-09 07:27:10 -07:00
Andrey Zgarbul
bb88bad222 test several outputs 2019-05-09 12:10:11 +03:00
Andrey Zgarbul
7c1e4dbf11 fix traits 2019-05-09 07:36:52 +03:00
Andrey Zgarbul
5c5ba6fe82 rm asine, mv lgamma 2019-05-09 06:58:58 +03:00
Andrey Zgarbul
fcdb5a8c13 tests, fixes, format 2019-05-07 07:16:24 +03:00
Alex Crichton
47a543171c Run rustfmt 2019-05-02 11:44:58 -07:00
Alex Crichton
8d79795d70 Overhaul tests
* Move everything to azure pipelines
* Inline docker configuration in this repo (no `cross`)
* Delete `no-panic` example, use `#[no_panic]` instead.
2019-05-02 11:37:21 -07:00
Alex Crichton
7cb4a204a2 Rework how testing is done
Use a build script to generate musl reference outputs and then ensure
that everything gets hooked up to actually run reference tests.
2019-05-02 10:48:55 -07:00