Closed
Description
compile pow function that musl standard c library to wasm using clang, when with -ffreestanding flag, will get wrong result. for example:
#include <math.h>
void printdf(double a):
void test(){
printdf(pow((double)2.0, (double)0.3));
}
use following command to compile:
clang --target=wasm32 -ffreestanding ............... -o test.wasm
the function print 1,not 1.2311444133449163.
I test using all following version of clang, the results are the same, all are 1.
version:
v4.0, v7.0, v9.0
but, if I do not with -ffreestanding flag, all the result are 1.2311444133449163.
test environment:
OS:
apple, and centos
arch:
x86-64
Metadata
Metadata
Assignees
Labels
No labels