Skip to content

Commit

Permalink
Test instructions parsing for global variable access
Browse files Browse the repository at this point in the history
  • Loading branch information
virgil-serbanuta committed Jan 27, 2025
1 parent fe6d323 commit e3ad34e
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
65 changes: 65 additions & 0 deletions tests/binary-parsing/code-variable-global.wast.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<generatedTop>
<k>
#module (... types: #type (... type: [ i32 .ValTypes ] -> [ i32 .ValTypes ] , metadata: ) .EmptyStmts , funcs: #func (... type: 0 , locals: [ i32 i64 .ValTypes ] , body: #global.get ( 0 ) #global.set ( 0 ) i32 . const 1 return .EmptyStmts , metadata: #meta (... id: , localIds: .Map ) ) .EmptyStmts , tables: .EmptyStmts , mems: .EmptyStmts , globals: #global (... type: var i32 , init: i32 . const 1048576 .EmptyStmts , metadata: ) .EmptyStmts , elem: .EmptyStmts , data: .EmptyStmts , start: .EmptyStmts , importDefns: .EmptyStmts , exports: .EmptyStmts , metadata: #meta (... id: , funcIds: .Map , filename: .String ) ) ~> .K
</k>
<wasm>
<instrs>
.K
</instrs>
<valstack>
.ValStack
</valstack>
<curFrame>
<locals>
.List
</locals>
<curModIdx>
.Int
</curModIdx>
</curFrame>
<moduleRegistry>
.Map
</moduleRegistry>
<moduleIds>
.Map
</moduleIds>
<moduleInstances>
.ModuleInstCellMap
</moduleInstances>
<nextModuleIdx>
0
</nextModuleIdx>
<mainStore>
<funcs>
.FuncDefCellMap
</funcs>
<nextFuncAddr>
0
</nextFuncAddr>
<tabs>
.TabInstCellMap
</tabs>
<nextTabAddr>
0
</nextTabAddr>
<mems>
.List
</mems>
<globals>
.GlobalInstCellMap
</globals>
<nextGlobAddr>
0
</nextGlobAddr>
<elems>
.ElemInstCellMap
</elems>
<nextElemAddr>
0
</nextElemAddr>
</mainStore>
<deterministicMemoryGrowth>
true
</deterministicMemoryGrowth>
</wasm>
</generatedTop>
1 change: 0 additions & 1 deletion tests/binary-parsing/failing
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
tests/binary-parsing/type-param-v128.wast
tests/binary-parsing/code-call-indirect.wast
tests/binary-parsing/code-variable-global.wast
tests/binary-parsing/code-memory-mem-init-data-drop.wast
tests/binary-parsing/code-numeric-float-parsing.md
tests/binary-parsing/code-numeric-convert-reinterpret.wast

0 comments on commit e3ad34e

Please sign in to comment.