Skip to content

Commit

Permalink
Add test using a compiler builtin
Browse files Browse the repository at this point in the history
This uses the `__floatditf` function which was reported as an issue in
[wasi-libc#543]. Compiling and running this test should prove that the
builtins are available in the `wasm32-*-threads` targets as long as the
tests use those targets (they do, right?).

[wasi-libc#543]: WebAssembly/wasi-libc#543
  • Loading branch information
abrown committed Oct 17, 2024
1 parent 9096f4b commit 1723c05
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/general/builtin-floatditf.c
Original file line number Diff line number Diff line change
@@ -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 <assert.h>

int main() {
tf_float f = __floatditf(0);
assert(f == 0.0);
return 0;
}

0 comments on commit 1723c05

Please sign in to comment.