add_test_executable(guest_floating_prefix_tests ${LIBS_INCLUDE_DIR}/tests/GuestFloatingPrefix.cpp
    ${LIBS_INCLUDE_DIR}/nid/src/NidCompute.cpp ${LIBS_INCLUDE_DIR}/nid/src/Sha1.cpp)
target_include_directories(guest_floating_prefix_tests PRIVATE ${LIBS_INCLUDE_DIR} ${LIBS_INCLUDE_DIR}/nid/include)
target_link_libraries(guest_floating_prefix_tests PRIVATE ${CMAKE_DL_LIBS})
configure_windows_unwind(guest_floating_prefix_tests)
if(MINGW)
    target_link_libraries(guest_floating_prefix_tests PRIVATE libc)
endif()
add_custom_target(guest_floating_prefix_libraries DEPENDS ${LIBC_PATCHED})
add_dependencies(guest_floating_prefix_tests guest_floating_prefix_libraries)
foreach(width IN ITEMS narrow wide)
    add_test(NAME guest_floating_prefix_${width} COMMAND guest_floating_prefix_tests $<TARGET_FILE_DIR:libc> unpatched ${width})
    add_test(NAME guest_floating_prefix_${width}_patched COMMAND guest_floating_prefix_tests ${PATCHED_DIR} patched ${width})
    set_tests_properties(guest_floating_prefix_${width} guest_floating_prefix_${width}_patched PROPERTIES TIMEOUT 10)
    if(WIN32)
        set_tests_properties(guest_floating_prefix_${width} PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<TARGET_FILE_DIR:libc>")
        set_tests_properties(guest_floating_prefix_${width}_patched PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:${PATCHED_DIR}")
    endif()
endforeach()
