pico-sdk/test/pico_divider_test/CMakeLists.txt
Graham Sanderson 574fdee37b
Fixup divider save_restore for floating point too; improve tests (#405)
- The divider state needs to be saved for __aeabi_ddiv, __aeabi_fdiv, __aeabi_dtan and __aeabi_ftan or they won't work in interrupts *(probably not used much youd hope), or on an RTOS context switch
 - Refactored code out for the integer and floating point cases
 - Improved the floating point 'tests' in passing to check more return values against GCC implementations
 - Added floating point usage to the IRQ nesting test case
2021-05-13 07:38:42 -05:00

38 lines
1.6 KiB
CMake

PROJECT(pico_divider_test)
if (PICO_ON_DEVICE)
add_executable(pico_divider_test
pico_divider_test.c
)
target_link_libraries(pico_divider_test pico_stdlib)
pico_set_divider_implementation(pico_divider_test hardware_explicit) # want to compare against compiler impl
pico_add_extra_outputs(pico_divider_test)
target_compile_definitions(pico_divider_test PRIVATE
# PICO_DIVIDER_DISABLE_INTERRUPTS=1
# TURBO
)
# this is a separate test as hardware_explicit above causes it not to be tested at all!
add_library(pico_divider_nesting_test_core INTERFACE)
target_sources(pico_divider_nesting_test_core INTERFACE
pico_divider_nesting_test.c
)
target_link_libraries(pico_divider_nesting_test_core INTERFACE pico_stdlib hardware_dma)
add_executable(pico_divider_nesting_test_with_dirty_check)
target_link_libraries(pico_divider_nesting_test_with_dirty_check pico_divider_nesting_test_core)
pico_set_divider_implementation(pico_divider_nesting_test_with_dirty_check hardware)
pico_add_extra_outputs(pico_divider_nesting_test_with_dirty_check)
add_executable(pico_divider_nesting_test_with_disable_irq)
target_link_libraries(pico_divider_nesting_test_with_disable_irq pico_divider_nesting_test_core)
target_compile_definitions(pico_divider_nesting_test_with_disable_irq PRIVATE
PICO_DIVIDER_DISABLE_INTERRUPTS=1)
pico_set_divider_implementation(pico_divider_nesting_test_with_disable_irq hardware)
pico_add_extra_outputs(pico_divider_nesting_test_with_disable_irq)
endif()