Commit 60df7abc authored by zhengxing.li's avatar zhengxing.li Committed by Commit bot

Use float and double for test cases in test-run-wasm-asmjs.cc

  The last 4 test cases in test/cctest/wasm/test-run-wasm-asmjs.cc added by the CL 36911 (https://codereview.chromium.org/2061583002) use float_t and double_t type for WasmRunner.
  For examples: At line 249: WasmRunner<float_t> r(&module, MachineType::Uint32());

  But float_t and double_t depends on FLT_EVAL_METHOD macro of compiler. FLT_EVAL_METHOD is variant on different platform, if the FLT_EVAL_METHOD is 2,  both float_t and double_t will be long
  double and gcc or clang will met error when compiling   WasmRunner<long double> r(&module,MachineType::Uint32());

  For more details, please refer:
  float_t: http://www.cplusplus.com/reference/cmath/float_t/
  FLT_EVAL_METHOD: https://en.wikipedia.org/wiki/C99 check the IEEE 754 floating point support section directly.

  This CL used float and double to replace float_t and double_t to avoid this issue.

BUG=

Review-Url: https://codereview.chromium.org/2066703003
Cr-Commit-Position: refs/heads/master@{#36982}
parent 3b677563
...@@ -246,7 +246,7 @@ FOREACH_INT_CHECKED_STORE_OP(INT_STORE_TEST) ...@@ -246,7 +246,7 @@ FOREACH_INT_CHECKED_STORE_OP(INT_STORE_TEST)
TEST(RunWasm_AsmCheckedLoadFloat32RelocInfo) { TEST(RunWasm_AsmCheckedLoadFloat32RelocInfo) {
TestingModule module(kExecuteCompiled); TestingModule module(kExecuteCompiled);
WasmRunner<float_t> r(&module, MachineType::Uint32()); WasmRunner<float> r(&module, MachineType::Uint32());
BUILD(r, WASM_UNOP(kExprF32AsmjsLoadMem, WASM_GET_LOCAL(0))); BUILD(r, WASM_UNOP(kExprF32AsmjsLoadMem, WASM_GET_LOCAL(0)));
CHECK_EQ(1, GetMatchingRelocInfoCount(module.instance->function_code[0], CHECK_EQ(1, GetMatchingRelocInfoCount(module.instance->function_code[0],
...@@ -255,7 +255,7 @@ TEST(RunWasm_AsmCheckedLoadFloat32RelocInfo) { ...@@ -255,7 +255,7 @@ TEST(RunWasm_AsmCheckedLoadFloat32RelocInfo) {
TEST(RunWasm_AsmCheckedStoreFloat32RelocInfo) { TEST(RunWasm_AsmCheckedStoreFloat32RelocInfo) {
TestingModule module(kExecuteCompiled); TestingModule module(kExecuteCompiled);
WasmRunner<float_t> r(&module, MachineType::Uint32(), MachineType::Float32()); WasmRunner<float> r(&module, MachineType::Uint32(), MachineType::Float32());
BUILD(r, WASM_BINOP(kExprF32AsmjsStoreMem, WASM_GET_LOCAL(0), BUILD(r, WASM_BINOP(kExprF32AsmjsStoreMem, WASM_GET_LOCAL(0),
WASM_GET_LOCAL(1))); WASM_GET_LOCAL(1)));
...@@ -265,7 +265,7 @@ TEST(RunWasm_AsmCheckedStoreFloat32RelocInfo) { ...@@ -265,7 +265,7 @@ TEST(RunWasm_AsmCheckedStoreFloat32RelocInfo) {
TEST(RunWasm_AsmCheckedLoadFloat64RelocInfo) { TEST(RunWasm_AsmCheckedLoadFloat64RelocInfo) {
TestingModule module(kExecuteCompiled); TestingModule module(kExecuteCompiled);
WasmRunner<double_t> r(&module, MachineType::Uint32()); WasmRunner<double> r(&module, MachineType::Uint32());
BUILD(r, WASM_UNOP(kExprF64AsmjsLoadMem, WASM_GET_LOCAL(0))); BUILD(r, WASM_UNOP(kExprF64AsmjsLoadMem, WASM_GET_LOCAL(0)));
CHECK_EQ(1, GetMatchingRelocInfoCount(module.instance->function_code[0], CHECK_EQ(1, GetMatchingRelocInfoCount(module.instance->function_code[0],
...@@ -274,8 +274,7 @@ TEST(RunWasm_AsmCheckedLoadFloat64RelocInfo) { ...@@ -274,8 +274,7 @@ TEST(RunWasm_AsmCheckedLoadFloat64RelocInfo) {
TEST(RunWasm_AsmCheckedStoreFloat64RelocInfo) { TEST(RunWasm_AsmCheckedStoreFloat64RelocInfo) {
TestingModule module(kExecuteCompiled); TestingModule module(kExecuteCompiled);
WasmRunner<double_t> r(&module, MachineType::Uint32(), WasmRunner<double> r(&module, MachineType::Uint32(), MachineType::Float64());
MachineType::Float64());
BUILD(r, WASM_BINOP(kExprF64AsmjsStoreMem, WASM_GET_LOCAL(0), BUILD(r, WASM_BINOP(kExprF64AsmjsStoreMem, WASM_GET_LOCAL(0),
WASM_GET_LOCAL(1))); WASM_GET_LOCAL(1)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment