diff --git a/src/library.js b/src/library.js index 7b21ac415b687..fabc1b0a0caa2 100644 --- a/src/library.js +++ b/src/library.js @@ -1356,6 +1356,8 @@ LibraryManager.library = { llvm_log_f64: 'Math_log', llvm_exp_f32: 'Math_exp', llvm_exp_f64: 'Math_exp', + llvm_sin_f32: 'Math_sin', + llvm_sin_f64: 'Math_sin', llvm_trunc_f32: 'Math_trunc', llvm_trunc_f64: 'Math_trunc', llvm_floor_f32: 'Math_floor', diff --git a/tests/core/test_llvm_intrinsics.in b/tests/core/test_llvm_intrinsics.in index 04f60ed6648eb..8b59e3376e29b 100644 --- a/tests/core/test_llvm_intrinsics.in +++ b/tests/core/test_llvm_intrinsics.in @@ -17,6 +17,8 @@ extern float llvm_trunc_f32(float x); extern double llvm_trunc_f64(double x); extern float llvm_floor_f32(float x); extern double llvm_floor_f64(double x); +extern float llvm_sin_f32(float x); +extern double llvm_sin_f64(double x); } int main(void) { @@ -52,6 +54,8 @@ int main(void) { printf("%d\n", (int)llvm_trunc_f64(-12.42)); printf("%d\n", (int)llvm_floor_f32(27.665f)); printf("%d\n", (int)llvm_floor_f64(-8.95)); + printf("%.1f\n", llvm_sin_f32(90.0f * 3.14/180)); + printf("%.1f\n", llvm_sin_f64(270.0 * 3.14/180)); return 0; } diff --git a/tests/core/test_llvm_intrinsics.out b/tests/core/test_llvm_intrinsics.out index 5a137f8765ec4..39fa3392ce155 100644 --- a/tests/core/test_llvm_intrinsics.out +++ b/tests/core/test_llvm_intrinsics.out @@ -13,4 +13,6 @@ c5,de,15,8a 18 -12 27 --9 \ No newline at end of file +-9 +1.0 +-1.0 \ No newline at end of file