wasmer/lib/emscripten-tests/emtests/test_lower_intrinsics.c

36 lines
710 B
C
Raw Normal View History

2018-12-27 07:46:41 +00:00
/*
* Copyright 2018 The Emscripten Authors. All rights reserved.
* Emscripten is available under two separate licenses, the MIT license and the
* University of Illinois/NCSA Open Source License. Both these licenses can be
* found in the LICENSE file.
*/
#include <math.h>
#include <emscripten.h>
int main() {
volatile float f = 1.0f;
volatile double d = 2.0;
#define TEST1(name) { \
volatile float tf = name##f(f); \
volatile double td = name(d); \
}
TEST1(cos);
TEST1(exp);
TEST1(log);
TEST1(sin);
TEST1(sqrt);
#define TEST2(name) { \
volatile float tf = name##f(f, f); \
volatile double td = name(d, d); \
}
TEST2(pow);
EM_ASM({
out('ok.');
});
}