Skip to content

Commit 38ae65b

Browse files
committed
Add test using a compiler builtin
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
1 parent 021e8dc commit 38ae65b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/general/builtin-floatditf.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Primarily check that `libclang_rt.builtins-wasm32.a` functions are present
2+
// and work as expected on all tested targets, not the builtin functionality.
3+
4+
#include <assert.h>
5+
6+
int main() {
7+
tf_float f = __floatditf(0);
8+
assert(f == 0.0);
9+
return 0;
10+
}

0 commit comments

Comments
 (0)