tests/sprintf: Test floating printf on soft-fp targets too
There's no reason to limit testing floating point printf to platforms with an FPU; neither the minimal C library nor picolibc even use floating point instructions for printf. And even if they did, the toolchain should have soft float support. However, we do need to restrict picolibc testing to configurations with floating point printf enabled. Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
2c75070360
commit
33dedfbd7d
@ -42,6 +42,9 @@
|
||||
#define IS_MINIMAL_LIBC_NOFP (IS_ENABLED(CONFIG_MINIMAL_LIBC) \
|
||||
&& !IS_ENABLED(CONFIG_CBPRINTF_FP_SUPPORT))
|
||||
|
||||
#define IS_PICOLIBC_NOFP (IS_ENABLED(CONFIG_PICOLIBC) \
|
||||
&& !IS_ENABLED(CONFIG_PICOLIBC_IO_FLOAT))
|
||||
|
||||
/*
|
||||
* A really long string (330 characters + NULL).
|
||||
* The underlying sprintf() architecture will truncate it.
|
||||
@ -106,11 +109,11 @@ ZTEST(sprintf, test_sprintf_double)
|
||||
/* Conversion not supported with minimal_libc without
|
||||
* CBPRINTF_FP_SUPPORT.
|
||||
*
|
||||
* Conversion not supported without FPU except on native POSIX.
|
||||
* Conversion not supported with picolibc without
|
||||
* PICOLIBC_IO_FLOAT
|
||||
*
|
||||
*/
|
||||
if (IS_MINIMAL_LIBC_NOFP
|
||||
|| !(IS_ENABLED(CONFIG_FPU)
|
||||
|| IS_ENABLED(CONFIG_BOARD_NATIVE_POSIX))) {
|
||||
if (IS_MINIMAL_LIBC_NOFP || IS_PICOLIBC_NOFP) {
|
||||
ztest_test_skip();
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user