Skip to content

Commit

Permalink
[interpreter/test] Fix inconsistent use of float values in spectest (
Browse files Browse the repository at this point in the history
  • Loading branch information
f52985 authored Jan 9, 2024
1 parent bfbc5cc commit 52e3cb0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions interpreter/script/js.ml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ let spectest = {
print_f64: console.log.bind(console),
global_i32: 666,
global_i64: 666n,
global_f32: 666,
global_f64: 666,
global_f32: 666.6,
global_f64: 666.6,
table: new WebAssembly.Table({initial: 10, maximum: 20, element: 'anyfunc'}),
memory: new WebAssembly.Memory({initial: 1, maximum: 2})
};
Expand Down
6 changes: 6 additions & 0 deletions test/core/imports.wast
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,18 @@
(func (export "get-1") (result i32) (global.get 1))
(func (export "get-x") (result i32) (global.get $x))
(func (export "get-y") (result i32) (global.get $y))
(func (export "get-4") (result i64) (global.get 4))
(func (export "get-5") (result f32) (global.get 5))
(func (export "get-6") (result f64) (global.get 6))
)

(assert_return (invoke "get-0") (i32.const 666))
(assert_return (invoke "get-1") (i32.const 666))
(assert_return (invoke "get-x") (i32.const 666))
(assert_return (invoke "get-y") (i32.const 666))
(assert_return (invoke "get-4") (i64.const 666))
(assert_return (invoke "get-5") (f32.const 666.6))
(assert_return (invoke "get-6") (f64.const 666.6))

(module (import "test" "global-i32" (global i32)))
(module (import "test" "global-f32" (global f32)))
Expand Down
4 changes: 2 additions & 2 deletions test/harness/async_index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ function reinitializeRegistry() {
print_f64: console.log.bind(console),
global_i32: 666,
global_i64: 666n,
global_f32: 666,
global_f64: 666,
global_f32: 666.6,
global_f64: 666.6,
table: new WebAssembly.Table({
initial: 10,
maximum: 20,
Expand Down
4 changes: 2 additions & 2 deletions test/harness/sync_index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ function reinitializeRegistry() {
print_f64: console.log.bind(console),
global_i32: 666,
global_i64: 666n,
global_f32: 666,
global_f64: 666,
global_f32: 666.6,
global_f64: 666.6,
table: new WebAssembly.Table({initial: 10, maximum: 20, element: 'anyfunc'}),
memory: new WebAssembly.Memory({initial: 1, maximum: 2})
};
Expand Down

0 comments on commit 52e3cb0

Please sign in to comment.