@@ -14,7 +14,15 @@ if [ -z "$target" ]; then
1414 target=" $host_target "
1515fi
1616
17- extra_flags=" "
17+ # We enumerate features manually.
18+ extra_flags=" --no-default-features"
19+
20+ # Enable arch-specific routines when available.
21+ extra_flags=" $extra_flags --features arch"
22+
23+ # Always enable `unstable-float` since it expands available API but does not
24+ # change any implementations.
25+ extra_flags=" $extra_flags --features unstable-float"
1826
1927# We need to specifically skip tests for musl-math-sys on systems that can't
2028# build musl since otherwise `--all` will activate it.
@@ -44,11 +52,11 @@ case "$target" in
4452 # Targets that aren't cross compiled work fine
4553 # FIXME(ci): we should be able to enable aarch64 Linux here once GHA
4654 # support rolls out.
47- x86_64* ) extra_flags=" $extra_flags --features libm-test/test-multiprecision " ;;
48- i686* ) extra_flags=" $extra_flags --features libm-test/test-multiprecision " ;;
49- i586* ) extra_flags=" $extra_flags --features libm-test/test-multiprecision --features gmp-mpfr-sys/force-cross" ;;
55+ x86_64* ) extra_flags=" $extra_flags --features libm-test/build-mpfr " ;;
56+ i686* ) extra_flags=" $extra_flags --features libm-test/build-mpfr " ;;
57+ i586* ) extra_flags=" $extra_flags --features libm-test/build-mpfr --features gmp-mpfr-sys/force-cross" ;;
5058 # Apple aarch64 is native
51- aarch64* apple* ) extra_flags=" $extra_flags --features libm-test/test-multiprecision " ;;
59+ aarch64* apple* ) extra_flags=" $extra_flags --features libm-test/build-mpfr " ;;
5260esac
5361
5462# FIXME: `STATUS_DLL_NOT_FOUND` testing macros on CI.
@@ -57,14 +65,8 @@ case "$target" in
5765 * windows-gnu) extra_flags=" $extra_flags --exclude libm-macros" ;;
5866esac
5967
60- # Make sure we can build with overriding features. We test the indibidual
61- # features it controls separately.
62- cargo check --no-default-features
63- cargo check --features " force-soft-floats"
64-
65- # Always enable `unstable-float` since it expands available API but does not
66- # change any implementations.
67- extra_flags=" $extra_flags --features unstable-float"
68+ # Make sure we can build with overriding features.
69+ cargo check -p libm --no-default-features
6870
6971if [ " ${BUILD_ONLY:- } " = " 1" ]; then
7072 cmd=" cargo build --target $target --package libm"
8082 $cmd --features unstable-intrinsics
8183 $cmd --features unstable-intrinsics --benches
8284
83- # Test the same in release mode, which also increases coverage.
85+ # Test the same in release mode, which also increases coverage. Also ensure
86+ # the soft float routines are checked.
8487 $cmd --profile release-checked
88+ $cmd --profile release-checked --features force-soft-floats
8589 $cmd --profile release-checked --features unstable-intrinsics
8690 $cmd --profile release-checked --features unstable-intrinsics --benches
8791
88- ENSURE_NO_PANIC=1 cargo build --target " $target " --release
92+ # Ensure that the routines do not panic.
93+ ENSURE_NO_PANIC=1 cargo build -p libm --target " $target " --no-default-features --release
8994fi
9095
0 commit comments