Skip to content

Commit 52e3cb0

Browse files
authored
[interpreter/test] Fix inconsistent use of float values in spectest (WebAssembly#1718)
1 parent bfbc5cc commit 52e3cb0

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

interpreter/script/js.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ let spectest = {
4444
print_f64: console.log.bind(console),
4545
global_i32: 666,
4646
global_i64: 666n,
47-
global_f32: 666,
48-
global_f64: 666,
47+
global_f32: 666.6,
48+
global_f64: 666.6,
4949
table: new WebAssembly.Table({initial: 10, maximum: 20, element: 'anyfunc'}),
5050
memory: new WebAssembly.Memory({initial: 1, maximum: 2})
5151
};

test/core/imports.wast

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,18 @@
238238
(func (export "get-1") (result i32) (global.get 1))
239239
(func (export "get-x") (result i32) (global.get $x))
240240
(func (export "get-y") (result i32) (global.get $y))
241+
(func (export "get-4") (result i64) (global.get 4))
242+
(func (export "get-5") (result f32) (global.get 5))
243+
(func (export "get-6") (result f64) (global.get 6))
241244
)
242245

243246
(assert_return (invoke "get-0") (i32.const 666))
244247
(assert_return (invoke "get-1") (i32.const 666))
245248
(assert_return (invoke "get-x") (i32.const 666))
246249
(assert_return (invoke "get-y") (i32.const 666))
250+
(assert_return (invoke "get-4") (i64.const 666))
251+
(assert_return (invoke "get-5") (f32.const 666.6))
252+
(assert_return (invoke "get-6") (f64.const 666.6))
247253

248254
(module (import "test" "global-i32" (global i32)))
249255
(module (import "test" "global-f32" (global f32)))

test/harness/async_index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ function reinitializeRegistry() {
100100
print_f64: console.log.bind(console),
101101
global_i32: 666,
102102
global_i64: 666n,
103-
global_f32: 666,
104-
global_f64: 666,
103+
global_f32: 666.6,
104+
global_f64: 666.6,
105105
table: new WebAssembly.Table({
106106
initial: 10,
107107
maximum: 20,

test/harness/sync_index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ function reinitializeRegistry() {
110110
print_f64: console.log.bind(console),
111111
global_i32: 666,
112112
global_i64: 666n,
113-
global_f32: 666,
114-
global_f64: 666,
113+
global_f32: 666.6,
114+
global_f64: 666.6,
115115
table: new WebAssembly.Table({initial: 10, maximum: 20, element: 'anyfunc'}),
116116
memory: new WebAssembly.Memory({initial: 1, maximum: 2})
117117
};

0 commit comments

Comments
 (0)