diff --git a/cmake/wasi-sdk-sysroot.cmake b/cmake/wasi-sdk-sysroot.cmake index 21c8c4f..2ef0591 100644 --- a/cmake/wasi-sdk-sysroot.cmake +++ b/cmake/wasi-sdk-sysroot.cmake @@ -106,10 +106,14 @@ add_custom_target(compiler-rt-post-build COMMAND ${CMAKE_COMMAND} -E copy_directory ${clang_resource_dir}/include ${wasi_resource_dir}/include - # Copy the `lib/wasi` folder to `libc/wasi{p1,p2}` to ensure that those - # OS-strings also work for looking up the compiler-rt.a file. + # Copy the `lib/wasi` folder to `libc/wasi{p1,p2}{-threads}?` to ensure that + # those OS-strings also work for looking up the compiler-rt.a file. + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${wasi_resource_dir}/lib/wasi ${wasi_resource_dir}/lib/wasi-threads COMMAND ${CMAKE_COMMAND} -E copy_directory ${wasi_resource_dir}/lib/wasi ${wasi_resource_dir}/lib/wasip1 + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${wasi_resource_dir}/lib/wasi ${wasi_resource_dir}/lib/wasip1-threads COMMAND ${CMAKE_COMMAND} -E copy_directory ${wasi_resource_dir}/lib/wasi ${wasi_resource_dir}/lib/wasip2 diff --git a/tests/general/builtin-floatdidf.c b/tests/general/builtin-floatdidf.c new file mode 100644 index 0000000..ddfd5c9 --- /dev/null +++ b/tests/general/builtin-floatdidf.c @@ -0,0 +1,10 @@ +// Primarily check that `libclang_rt.builtins-wasm32.a` functions are present +// and work as expected on all tested targets, not the builtin functionality. + +#include + +int main() { + double f = __floatdidf(0); + assert(f == 0.0); + return 0; +}