Skip to content

Script support for testing dynamic linking #325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed

Conversation

rossberg
Copy link
Member

@rossberg rossberg commented Sep 1, 2016

This adds script facilities for defining multiple modules, naming them, and registering them. It also refactors the command grammar slightly and adds an "action" to get the value of an exported global (analogous to invoke for functions).

cmd:
  <module>                                  ;; define, validate, and initialize module
  <action>                                  ;; perform action and print results
  ( register <string> <name>? )             ;; register module for imports
  ( assert_return <action> <expr>? )        ;; assert action has expected results
  ( assert_return_nan <action> )            ;; assert action results in NaN
  ( assert_trap <action> <failure> )        ;; assert action traps with given failure string
  ( assert_invalid <module> <failure> )     ;; assert module is invalid with given failure string
  ( assert_unlinkable <module> <failure> )  ;; assert module fails to link module with given failure string
  ( input <string> )                        ;; read script or module from file
  ( output <name>? <string>? )              ;; output module to stout or file

action:
  ( invoke <name>? <string> <expr>* )       ;; invoke function export
  ( get <name>? <string> )                  ;; get global export

Module names remain optional. If omitted at use sites, the last defined module is implied as before.

A registered module is available for importing. See test/linking.wast for a number of examples.

@lukewagner
Copy link
Member

Cool, looks useful, lgtm

@rossberg
Copy link
Member Author

rossberg commented Sep 7, 2016

Merged into binary-0xc.

@rossberg rossberg closed this Sep 7, 2016
@rossberg rossberg deleted the dynlink branch May 18, 2017 11:16
ngzhian added a commit to ngzhian/spec that referenced this pull request Nov 4, 2021
Adding all shr_u and also i64x2 shifts.
dhil pushed a commit to dhil/webassembly-spec that referenced this pull request Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants