github.com/wasilibs/wazerox@v0.0.0-20240124024944-4923be63ab5f/internal/integration_test/spectest/v2/testdata/linking.json (about) 1 {"source_filename": "./linking.wast", 2 "commands": [ 3 {"type": "module", "line": 3, "name": "$Mf", "filename": "linking.0.wasm"}, 4 {"type": "register", "line": 7, "name": "$Mf", "as": "Mf"}, 5 {"type": "module", "line": 9, "name": "$Nf", "filename": "linking.1.wasm"}, 6 {"type": "assert_return", "line": 17, "action": {"type": "invoke", "module": "$Mf", "field": "call", "args": []}, "expected": [{"type": "i32", "value": "2"}]}, 7 {"type": "assert_return", "line": 18, "action": {"type": "invoke", "module": "$Nf", "field": "Mf.call", "args": []}, "expected": [{"type": "i32", "value": "2"}]}, 8 {"type": "assert_return", "line": 19, "action": {"type": "invoke", "module": "$Nf", "field": "call", "args": []}, "expected": [{"type": "i32", "value": "3"}]}, 9 {"type": "assert_return", "line": 20, "action": {"type": "invoke", "module": "$Nf", "field": "call Mf.call", "args": []}, "expected": [{"type": "i32", "value": "2"}]}, 10 {"type": "module", "line": 22, "filename": "linking.2.wasm"}, 11 {"type": "register", "line": 26, "as": "reexport_f"}, 12 {"type": "assert_unlinkable", "line": 28, "filename": "linking.3.wasm", "text": "incompatible import type", "module_type": "binary"}, 13 {"type": "assert_unlinkable", "line": 32, "filename": "linking.4.wasm", "text": "incompatible import type", "module_type": "binary"}, 14 {"type": "module", "line": 39, "name": "$Mg", "filename": "linking.5.wasm"}, 15 {"type": "register", "line": 48, "name": "$Mg", "as": "Mg"}, 16 {"type": "module", "line": 50, "name": "$Ng", "filename": "linking.6.wasm"}, 17 {"type": "assert_return", "line": 67, "action": {"type": "get", "module": "$Mg", "field": "glob"}, "expected": [{"type": "i32", "value": "42"}]}, 18 {"type": "assert_return", "line": 68, "action": {"type": "get", "module": "$Ng", "field": "Mg.glob"}, "expected": [{"type": "i32", "value": "42"}]}, 19 {"type": "assert_return", "line": 69, "action": {"type": "get", "module": "$Ng", "field": "glob"}, "expected": [{"type": "i32", "value": "43"}]}, 20 {"type": "assert_return", "line": 70, "action": {"type": "invoke", "module": "$Mg", "field": "get", "args": []}, "expected": [{"type": "i32", "value": "42"}]}, 21 {"type": "assert_return", "line": 71, "action": {"type": "invoke", "module": "$Ng", "field": "Mg.get", "args": []}, "expected": [{"type": "i32", "value": "42"}]}, 22 {"type": "assert_return", "line": 72, "action": {"type": "invoke", "module": "$Ng", "field": "get", "args": []}, "expected": [{"type": "i32", "value": "43"}]}, 23 {"type": "assert_return", "line": 74, "action": {"type": "get", "module": "$Mg", "field": "mut_glob"}, "expected": [{"type": "i32", "value": "142"}]}, 24 {"type": "assert_return", "line": 75, "action": {"type": "get", "module": "$Ng", "field": "Mg.mut_glob"}, "expected": [{"type": "i32", "value": "142"}]}, 25 {"type": "assert_return", "line": 76, "action": {"type": "invoke", "module": "$Mg", "field": "get_mut", "args": []}, "expected": [{"type": "i32", "value": "142"}]}, 26 {"type": "assert_return", "line": 77, "action": {"type": "invoke", "module": "$Ng", "field": "Mg.get_mut", "args": []}, "expected": [{"type": "i32", "value": "142"}]}, 27 {"type": "assert_return", "line": 79, "action": {"type": "invoke", "module": "$Mg", "field": "set_mut", "args": [{"type": "i32", "value": "241"}]}, "expected": []}, 28 {"type": "assert_return", "line": 80, "action": {"type": "get", "module": "$Mg", "field": "mut_glob"}, "expected": [{"type": "i32", "value": "241"}]}, 29 {"type": "assert_return", "line": 81, "action": {"type": "get", "module": "$Ng", "field": "Mg.mut_glob"}, "expected": [{"type": "i32", "value": "241"}]}, 30 {"type": "assert_return", "line": 82, "action": {"type": "invoke", "module": "$Mg", "field": "get_mut", "args": []}, "expected": [{"type": "i32", "value": "241"}]}, 31 {"type": "assert_return", "line": 83, "action": {"type": "invoke", "module": "$Ng", "field": "Mg.get_mut", "args": []}, "expected": [{"type": "i32", "value": "241"}]}, 32 {"type": "assert_unlinkable", "line": 87, "filename": "linking.7.wasm", "text": "incompatible import type", "module_type": "binary"}, 33 {"type": "assert_unlinkable", "line": 91, "filename": "linking.8.wasm", "text": "incompatible import type", "module_type": "binary"}, 34 {"type": "module", "line": 96, "name": "$Mref_ex", "filename": "linking.9.wasm"}, 35 {"type": "register", "line": 102, "name": "$Mref_ex", "as": "Mref_ex"}, 36 {"type": "module", "line": 104, "name": "$Mref_im", "filename": "linking.10.wasm"}, 37 {"type": "assert_unlinkable", "line": 113, "filename": "linking.11.wasm", "text": "incompatible import type", "module_type": "binary"}, 38 {"type": "assert_unlinkable", "line": 117, "filename": "linking.12.wasm", "text": "incompatible import type", "module_type": "binary"}, 39 {"type": "assert_unlinkable", "line": 123, "filename": "linking.13.wasm", "text": "incompatible import type", "module_type": "binary"}, 40 {"type": "assert_unlinkable", "line": 127, "filename": "linking.14.wasm", "text": "incompatible import type", "module_type": "binary"}, 41 {"type": "module", "line": 134, "name": "$Mt", "filename": "linking.15.wasm"}, 42 {"type": "register", "line": 147, "name": "$Mt", "as": "Mt"}, 43 {"type": "module", "line": 149, "name": "$Nt", "filename": "linking.16.wasm"}, 44 {"type": "assert_return", "line": 168, "action": {"type": "invoke", "module": "$Mt", "field": "call", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "4"}]}, 45 {"type": "assert_return", "line": 169, "action": {"type": "invoke", "module": "$Nt", "field": "Mt.call", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "4"}]}, 46 {"type": "assert_return", "line": 170, "action": {"type": "invoke", "module": "$Nt", "field": "call", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "5"}]}, 47 {"type": "assert_return", "line": 171, "action": {"type": "invoke", "module": "$Nt", "field": "call Mt.call", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "4"}]}, 48 {"type": "assert_trap", "line": 173, "action": {"type": "invoke", "module": "$Mt", "field": "call", "args": [{"type": "i32", "value": "1"}]}, "text": "uninitialized element", "expected": [{"type": "i32"}]}, 49 {"type": "assert_trap", "line": 174, "action": {"type": "invoke", "module": "$Nt", "field": "Mt.call", "args": [{"type": "i32", "value": "1"}]}, "text": "uninitialized element", "expected": [{"type": "i32"}]}, 50 {"type": "assert_return", "line": 175, "action": {"type": "invoke", "module": "$Nt", "field": "call", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "5"}]}, 51 {"type": "assert_trap", "line": 176, "action": {"type": "invoke", "module": "$Nt", "field": "call Mt.call", "args": [{"type": "i32", "value": "1"}]}, "text": "uninitialized element", "expected": [{"type": "i32"}]}, 52 {"type": "assert_trap", "line": 178, "action": {"type": "invoke", "module": "$Mt", "field": "call", "args": [{"type": "i32", "value": "0"}]}, "text": "uninitialized element", "expected": [{"type": "i32"}]}, 53 {"type": "assert_trap", "line": 179, "action": {"type": "invoke", "module": "$Nt", "field": "Mt.call", "args": [{"type": "i32", "value": "0"}]}, "text": "uninitialized element", "expected": [{"type": "i32"}]}, 54 {"type": "assert_return", "line": 180, "action": {"type": "invoke", "module": "$Nt", "field": "call", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "5"}]}, 55 {"type": "assert_trap", "line": 181, "action": {"type": "invoke", "module": "$Nt", "field": "call Mt.call", "args": [{"type": "i32", "value": "0"}]}, "text": "uninitialized element", "expected": [{"type": "i32"}]}, 56 {"type": "assert_trap", "line": 183, "action": {"type": "invoke", "module": "$Mt", "field": "call", "args": [{"type": "i32", "value": "20"}]}, "text": "undefined element", "expected": [{"type": "i32"}]}, 57 {"type": "assert_trap", "line": 184, "action": {"type": "invoke", "module": "$Nt", "field": "Mt.call", "args": [{"type": "i32", "value": "20"}]}, "text": "undefined element", "expected": [{"type": "i32"}]}, 58 {"type": "assert_trap", "line": 185, "action": {"type": "invoke", "module": "$Nt", "field": "call", "args": [{"type": "i32", "value": "7"}]}, "text": "undefined element", "expected": [{"type": "i32"}]}, 59 {"type": "assert_trap", "line": 186, "action": {"type": "invoke", "module": "$Nt", "field": "call Mt.call", "args": [{"type": "i32", "value": "20"}]}, "text": "undefined element", "expected": [{"type": "i32"}]}, 60 {"type": "assert_return", "line": 188, "action": {"type": "invoke", "module": "$Nt", "field": "call", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "i32", "value": "4294967292"}]}, 61 {"type": "assert_trap", "line": 189, "action": {"type": "invoke", "module": "$Nt", "field": "call", "args": [{"type": "i32", "value": "4"}]}, "text": "indirect call type mismatch", "expected": [{"type": "i32"}]}, 62 {"type": "module", "line": 191, "name": "$Ot", "filename": "linking.17.wasm"}, 63 {"type": "assert_return", "line": 204, "action": {"type": "invoke", "module": "$Mt", "field": "call", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "i32", "value": "4"}]}, 64 {"type": "assert_return", "line": 205, "action": {"type": "invoke", "module": "$Nt", "field": "Mt.call", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "i32", "value": "4"}]}, 65 {"type": "assert_return", "line": 206, "action": {"type": "invoke", "module": "$Nt", "field": "call Mt.call", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "i32", "value": "4"}]}, 66 {"type": "assert_return", "line": 207, "action": {"type": "invoke", "module": "$Ot", "field": "call", "args": [{"type": "i32", "value": "3"}]}, "expected": [{"type": "i32", "value": "4"}]}, 67 {"type": "assert_return", "line": 209, "action": {"type": "invoke", "module": "$Mt", "field": "call", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "4294967292"}]}, 68 {"type": "assert_return", "line": 210, "action": {"type": "invoke", "module": "$Nt", "field": "Mt.call", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "4294967292"}]}, 69 {"type": "assert_return", "line": 211, "action": {"type": "invoke", "module": "$Nt", "field": "call", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "5"}]}, 70 {"type": "assert_return", "line": 212, "action": {"type": "invoke", "module": "$Nt", "field": "call Mt.call", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "4294967292"}]}, 71 {"type": "assert_return", "line": 213, "action": {"type": "invoke", "module": "$Ot", "field": "call", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "4294967292"}]}, 72 {"type": "assert_return", "line": 215, "action": {"type": "invoke", "module": "$Mt", "field": "call", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "6"}]}, 73 {"type": "assert_return", "line": 216, "action": {"type": "invoke", "module": "$Nt", "field": "Mt.call", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "6"}]}, 74 {"type": "assert_return", "line": 217, "action": {"type": "invoke", "module": "$Nt", "field": "call", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "5"}]}, 75 {"type": "assert_return", "line": 218, "action": {"type": "invoke", "module": "$Nt", "field": "call Mt.call", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "6"}]}, 76 {"type": "assert_return", "line": 219, "action": {"type": "invoke", "module": "$Ot", "field": "call", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "6"}]}, 77 {"type": "assert_trap", "line": 221, "action": {"type": "invoke", "module": "$Mt", "field": "call", "args": [{"type": "i32", "value": "0"}]}, "text": "uninitialized element", "expected": [{"type": "i32"}]}, 78 {"type": "assert_trap", "line": 222, "action": {"type": "invoke", "module": "$Nt", "field": "Mt.call", "args": [{"type": "i32", "value": "0"}]}, "text": "uninitialized element", "expected": [{"type": "i32"}]}, 79 {"type": "assert_return", "line": 223, "action": {"type": "invoke", "module": "$Nt", "field": "call", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "5"}]}, 80 {"type": "assert_trap", "line": 224, "action": {"type": "invoke", "module": "$Nt", "field": "call Mt.call", "args": [{"type": "i32", "value": "0"}]}, "text": "uninitialized element", "expected": [{"type": "i32"}]}, 81 {"type": "assert_trap", "line": 225, "action": {"type": "invoke", "module": "$Ot", "field": "call", "args": [{"type": "i32", "value": "0"}]}, "text": "uninitialized element", "expected": [{"type": "i32"}]}, 82 {"type": "assert_trap", "line": 227, "action": {"type": "invoke", "module": "$Ot", "field": "call", "args": [{"type": "i32", "value": "20"}]}, "text": "undefined element", "expected": [{"type": "i32"}]}, 83 {"type": "module", "line": 229, "filename": "linking.18.wasm"}, 84 {"type": "module", "line": 235, "name": "$G1", "filename": "linking.19.wasm"}, 85 {"type": "register", "line": 236, "name": "$G1", "as": "G1"}, 86 {"type": "module", "line": 237, "name": "$G2", "filename": "linking.20.wasm"}, 87 {"type": "assert_return", "line": 241, "action": {"type": "get", "module": "$G2", "field": "g"}, "expected": [{"type": "i32", "value": "5"}]}, 88 {"type": "assert_uninstantiable", "line": 244, "filename": "linking.21.wasm", "text": "out of bounds table access", "module_type": "binary"}, 89 {"type": "assert_unlinkable", "line": 253, "filename": "linking.22.wasm", "text": "unknown import", "module_type": "binary"}, 90 {"type": "assert_trap", "line": 262, "action": {"type": "invoke", "module": "$Mt", "field": "call", "args": [{"type": "i32", "value": "7"}]}, "text": "uninitialized element", "expected": [{"type": "i32"}]}, 91 {"type": "assert_uninstantiable", "line": 267, "filename": "linking.23.wasm", "text": "out of bounds table access", "module_type": "binary"}, 92 {"type": "assert_return", "line": 275, "action": {"type": "invoke", "module": "$Mt", "field": "call", "args": [{"type": "i32", "value": "7"}]}, "expected": [{"type": "i32", "value": "0"}]}, 93 {"type": "assert_trap", "line": 276, "action": {"type": "invoke", "module": "$Mt", "field": "call", "args": [{"type": "i32", "value": "8"}]}, "text": "uninitialized element", "expected": [{"type": "i32"}]}, 94 {"type": "assert_uninstantiable", "line": 279, "filename": "linking.24.wasm", "text": "out of bounds memory access", "module_type": "binary"}, 95 {"type": "assert_return", "line": 288, "action": {"type": "invoke", "module": "$Mt", "field": "call", "args": [{"type": "i32", "value": "7"}]}, "expected": [{"type": "i32", "value": "0"}]}, 96 {"type": "module", "line": 291, "name": "$Mtable_ex", "filename": "linking.25.wasm"}, 97 {"type": "register", "line": 295, "name": "$Mtable_ex", "as": "Mtable_ex"}, 98 {"type": "module", "line": 297, "filename": "linking.26.wasm"}, 99 {"type": "assert_unlinkable", "line": 303, "filename": "linking.27.wasm", "text": "incompatible import type", "module_type": "binary"}, 100 {"type": "assert_unlinkable", "line": 307, "filename": "linking.28.wasm", "text": "incompatible import type", "module_type": "binary"}, 101 {"type": "module", "line": 314, "name": "$Mm", "filename": "linking.29.wasm"}, 102 {"type": "register", "line": 322, "name": "$Mm", "as": "Mm"}, 103 {"type": "module", "line": 324, "name": "$Nm", "filename": "linking.30.wasm"}, 104 {"type": "assert_return", "line": 336, "action": {"type": "invoke", "module": "$Mm", "field": "load", "args": [{"type": "i32", "value": "12"}]}, "expected": [{"type": "i32", "value": "2"}]}, 105 {"type": "assert_return", "line": 337, "action": {"type": "invoke", "module": "$Nm", "field": "Mm.load", "args": [{"type": "i32", "value": "12"}]}, "expected": [{"type": "i32", "value": "2"}]}, 106 {"type": "assert_return", "line": 338, "action": {"type": "invoke", "module": "$Nm", "field": "load", "args": [{"type": "i32", "value": "12"}]}, "expected": [{"type": "i32", "value": "242"}]}, 107 {"type": "module", "line": 340, "name": "$Om", "filename": "linking.31.wasm"}, 108 {"type": "assert_return", "line": 349, "action": {"type": "invoke", "module": "$Mm", "field": "load", "args": [{"type": "i32", "value": "12"}]}, "expected": [{"type": "i32", "value": "167"}]}, 109 {"type": "assert_return", "line": 350, "action": {"type": "invoke", "module": "$Nm", "field": "Mm.load", "args": [{"type": "i32", "value": "12"}]}, "expected": [{"type": "i32", "value": "167"}]}, 110 {"type": "assert_return", "line": 351, "action": {"type": "invoke", "module": "$Nm", "field": "load", "args": [{"type": "i32", "value": "12"}]}, "expected": [{"type": "i32", "value": "242"}]}, 111 {"type": "assert_return", "line": 352, "action": {"type": "invoke", "module": "$Om", "field": "load", "args": [{"type": "i32", "value": "12"}]}, "expected": [{"type": "i32", "value": "167"}]}, 112 {"type": "module", "line": 354, "filename": "linking.32.wasm"}, 113 {"type": "assert_uninstantiable", "line": 360, "filename": "linking.33.wasm", "text": "out of bounds memory access", "module_type": "binary"}, 114 {"type": "module", "line": 367, "name": "$Pm", "filename": "linking.34.wasm"}, 115 {"type": "assert_return", "line": 375, "action": {"type": "invoke", "module": "$Pm", "field": "grow", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "1"}]}, 116 {"type": "assert_return", "line": 376, "action": {"type": "invoke", "module": "$Pm", "field": "grow", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "1"}]}, 117 {"type": "assert_return", "line": 377, "action": {"type": "invoke", "module": "$Pm", "field": "grow", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "3"}]}, 118 {"type": "assert_return", "line": 378, "action": {"type": "invoke", "module": "$Pm", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "3"}]}, 119 {"type": "assert_return", "line": 379, "action": {"type": "invoke", "module": "$Pm", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "4"}]}, 120 {"type": "assert_return", "line": 380, "action": {"type": "invoke", "module": "$Pm", "field": "grow", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "5"}]}, 121 {"type": "assert_return", "line": 381, "action": {"type": "invoke", "module": "$Pm", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "4294967295"}]}, 122 {"type": "assert_return", "line": 382, "action": {"type": "invoke", "module": "$Pm", "field": "grow", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "5"}]}, 123 {"type": "assert_unlinkable", "line": 385, "filename": "linking.35.wasm", "text": "unknown import", "module_type": "binary"}, 124 {"type": "assert_return", "line": 393, "action": {"type": "invoke", "module": "$Mm", "field": "load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "0"}]}, 125 {"type": "assert_uninstantiable", "line": 398, "filename": "linking.36.wasm", "text": "out of bounds memory access", "module_type": "binary"}, 126 {"type": "assert_return", "line": 406, "action": {"type": "invoke", "module": "$Mm", "field": "load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "97"}]}, 127 {"type": "assert_return", "line": 407, "action": {"type": "invoke", "module": "$Mm", "field": "load", "args": [{"type": "i32", "value": "327670"}]}, "expected": [{"type": "i32", "value": "0"}]}, 128 {"type": "assert_uninstantiable", "line": 410, "filename": "linking.37.wasm", "text": "out of bounds table access", "module_type": "binary"}, 129 {"type": "assert_return", "line": 419, "action": {"type": "invoke", "module": "$Mm", "field": "load", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "97"}]}, 130 {"type": "module", "line": 422, "name": "$Ms", "filename": "linking.38.wasm"}, 131 {"type": "register", "line": 433, "name": "$Ms", "as": "Ms"}, 132 {"type": "assert_uninstantiable", "line": 436, "filename": "linking.39.wasm", "text": "unreachable", "module_type": "binary"}, 133 {"type": "assert_return", "line": 452, "action": {"type": "invoke", "module": "$Ms", "field": "get memory[0]", "args": []}, "expected": [{"type": "i32", "value": "104"}]}, 134 {"type": "assert_return", "line": 453, "action": {"type": "invoke", "module": "$Ms", "field": "get table[0]", "args": []}, "expected": [{"type": "i32", "value": "57005"}]}]}