Skip to content

Commit d52e42d

Browse files
committed
[interpreter] Document values in spectest module
1 parent 1904486 commit d52e42d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

interpreter/README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,9 @@ Commands are executed in sequence. Commands taking an optional module name refer
417417

418418
After a module is _registered_ under a string name it is available for importing in other modules.
419419

420+
The failure string in assertions exists for documentation purposes.
421+
The reference interpreter itself checks that the string is a prefix of the actual error message it generates.
422+
420423
The script format supports additional syntax for defining modules.
421424
A module of the form `(module binary <string>*)` is given in binary form and will be decoded from the (concatenation of the) strings.
422425
A module of the form `(module quote <string>*)` is given in textual form and will be parsed from the (concatenation of the) strings. In both cases, decoding/parsing happens when the command is executed, not when the script is parsed, so that meta commands like `assert_malformed` can be used to check expected errors.
@@ -435,14 +438,14 @@ It also supports an "unchecked" mode (flag `-u`), in which module definitions ar
435438
When running scripts, the interpreter predefines a simple host module named `"spectest"` that has the following module type:
436439
```
437440
(module
438-
(global (export "global_i32") i32)
439-
(global (export "global_i64") i64)
440-
(global (export "global_f32") f32)
441-
(global (export "global_f64") f64)
441+
(global (export "global_i32") i32) ;; value 666
442+
(global (export "global_i64") i64) ;; value 666
443+
(global (export "global_f32") f32) ;; value 666.6
444+
(global (export "global_f64") f64) ;; value 666.6
442445
443-
(table (export "table") 10 20 funcref)
446+
(table (export "table") 10 20 funcref) ;; null-initialized
444447
445-
(memory (export "memory") 1 2)
448+
(memory (export "memory") 1 2) ;; zero-initialized
446449
447450
(func (export "print"))
448451
(func (export "print_i32") (param i32))

0 commit comments

Comments
 (0)