github.com/tetratelabs/wazero@v1.7.3-0.20240513003603-48f702e154b5/internal/integration_test/spectest/v1/testdata/memory_grow.json (about) 1 {"source_filename": "./memory_grow.wast", 2 "commands": [ 3 {"type": "module", "line": 1, "filename": "memory_grow.0.wasm"}, 4 {"type": "assert_return", "line": 14, "action": {"type": "invoke", "field": "size", "args": []}, "expected": [{"type": "i32", "value": "0"}]}, 5 {"type": "assert_trap", "line": 15, "action": {"type": "invoke", "field": "store_at_zero", "args": []}, "text": "out of bounds memory access", "expected": []}, 6 {"type": "assert_trap", "line": 16, "action": {"type": "invoke", "field": "load_at_zero", "args": []}, "text": "out of bounds memory access", "expected": [{"type": "i32"}]}, 7 {"type": "assert_trap", "line": 17, "action": {"type": "invoke", "field": "store_at_page_size", "args": []}, "text": "out of bounds memory access", "expected": []}, 8 {"type": "assert_trap", "line": 18, "action": {"type": "invoke", "field": "load_at_page_size", "args": []}, "text": "out of bounds memory access", "expected": [{"type": "i32"}]}, 9 {"type": "assert_return", "line": 19, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "0"}]}, 10 {"type": "assert_return", "line": 20, "action": {"type": "invoke", "field": "size", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, 11 {"type": "assert_return", "line": 21, "action": {"type": "invoke", "field": "load_at_zero", "args": []}, "expected": [{"type": "i32", "value": "0"}]}, 12 {"type": "assert_return", "line": 22, "action": {"type": "invoke", "field": "store_at_zero", "args": []}, "expected": []}, 13 {"type": "assert_return", "line": 23, "action": {"type": "invoke", "field": "load_at_zero", "args": []}, "expected": [{"type": "i32", "value": "2"}]}, 14 {"type": "assert_trap", "line": 24, "action": {"type": "invoke", "field": "store_at_page_size", "args": []}, "text": "out of bounds memory access", "expected": []}, 15 {"type": "assert_trap", "line": 25, "action": {"type": "invoke", "field": "load_at_page_size", "args": []}, "text": "out of bounds memory access", "expected": [{"type": "i32"}]}, 16 {"type": "assert_return", "line": 26, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "4"}]}, "expected": [{"type": "i32", "value": "1"}]}, 17 {"type": "assert_return", "line": 27, "action": {"type": "invoke", "field": "size", "args": []}, "expected": [{"type": "i32", "value": "5"}]}, 18 {"type": "assert_return", "line": 28, "action": {"type": "invoke", "field": "load_at_zero", "args": []}, "expected": [{"type": "i32", "value": "2"}]}, 19 {"type": "assert_return", "line": 29, "action": {"type": "invoke", "field": "store_at_zero", "args": []}, "expected": []}, 20 {"type": "assert_return", "line": 30, "action": {"type": "invoke", "field": "load_at_zero", "args": []}, "expected": [{"type": "i32", "value": "2"}]}, 21 {"type": "assert_return", "line": 31, "action": {"type": "invoke", "field": "load_at_page_size", "args": []}, "expected": [{"type": "i32", "value": "0"}]}, 22 {"type": "assert_return", "line": 32, "action": {"type": "invoke", "field": "store_at_page_size", "args": []}, "expected": []}, 23 {"type": "assert_return", "line": 33, "action": {"type": "invoke", "field": "load_at_page_size", "args": []}, "expected": [{"type": "i32", "value": "3"}]}, 24 {"type": "module", "line": 36, "filename": "memory_grow.1.wasm"}, 25 {"type": "assert_return", "line": 41, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "0"}]}, 26 {"type": "assert_return", "line": 42, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "0"}]}, 27 {"type": "assert_return", "line": 43, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "1"}]}, 28 {"type": "assert_return", "line": 44, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "1"}]}, 29 {"type": "assert_return", "line": 45, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "800"}]}, "expected": [{"type": "i32", "value": "3"}]}, 30 {"type": "assert_return", "line": 46, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "65536"}]}, "expected": [{"type": "i32", "value": "4294967295"}]}, 31 {"type": "assert_return", "line": 47, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "64736"}]}, "expected": [{"type": "i32", "value": "4294967295"}]}, 32 {"type": "assert_return", "line": 48, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "803"}]}, 33 {"type": "module", "line": 50, "filename": "memory_grow.2.wasm"}, 34 {"type": "assert_return", "line": 55, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "0"}]}, 35 {"type": "assert_return", "line": 56, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "0"}]}, 36 {"type": "assert_return", "line": 57, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "1"}]}, 37 {"type": "assert_return", "line": 58, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "2"}]}, "expected": [{"type": "i32", "value": "2"}]}, 38 {"type": "assert_return", "line": 59, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "6"}]}, "expected": [{"type": "i32", "value": "4"}]}, 39 {"type": "assert_return", "line": 60, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "10"}]}, 40 {"type": "assert_return", "line": 61, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "4294967295"}]}, 41 {"type": "assert_return", "line": 62, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "65536"}]}, "expected": [{"type": "i32", "value": "4294967295"}]}, 42 {"type": "module", "line": 66, "filename": "memory_grow.3.wasm"}, 43 {"type": "assert_return", "line": 87, "action": {"type": "invoke", "field": "check-memory-zero", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "65535"}]}, "expected": [{"type": "i32", "value": "0"}]}, 44 {"type": "assert_return", "line": 88, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "1"}]}, 45 {"type": "assert_return", "line": 89, "action": {"type": "invoke", "field": "check-memory-zero", "args": [{"type": "i32", "value": "65536"}, {"type": "i32", "value": "131071"}]}, "expected": [{"type": "i32", "value": "0"}]}, 46 {"type": "assert_return", "line": 90, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "2"}]}, 47 {"type": "assert_return", "line": 91, "action": {"type": "invoke", "field": "check-memory-zero", "args": [{"type": "i32", "value": "131072"}, {"type": "i32", "value": "196607"}]}, "expected": [{"type": "i32", "value": "0"}]}, 48 {"type": "assert_return", "line": 92, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "3"}]}, 49 {"type": "assert_return", "line": 93, "action": {"type": "invoke", "field": "check-memory-zero", "args": [{"type": "i32", "value": "196608"}, {"type": "i32", "value": "262143"}]}, "expected": [{"type": "i32", "value": "0"}]}, 50 {"type": "assert_return", "line": 94, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "4"}]}, 51 {"type": "assert_return", "line": 95, "action": {"type": "invoke", "field": "check-memory-zero", "args": [{"type": "i32", "value": "262144"}, {"type": "i32", "value": "327679"}]}, "expected": [{"type": "i32", "value": "0"}]}, 52 {"type": "assert_return", "line": 96, "action": {"type": "invoke", "field": "grow", "args": [{"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "5"}]}, 53 {"type": "assert_return", "line": 97, "action": {"type": "invoke", "field": "check-memory-zero", "args": [{"type": "i32", "value": "327680"}, {"type": "i32", "value": "393215"}]}, "expected": [{"type": "i32", "value": "0"}]}, 54 {"type": "module", "line": 101, "filename": "memory_grow.4.wasm"}, 55 {"type": "assert_return", "line": 259, "action": {"type": "invoke", "field": "as-br-value", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, 56 {"type": "assert_return", "line": 261, "action": {"type": "invoke", "field": "as-br_if-cond", "args": []}, "expected": []}, 57 {"type": "assert_return", "line": 262, "action": {"type": "invoke", "field": "as-br_if-value", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, 58 {"type": "assert_return", "line": 263, "action": {"type": "invoke", "field": "as-br_if-value-cond", "args": []}, "expected": [{"type": "i32", "value": "6"}]}, 59 {"type": "assert_return", "line": 265, "action": {"type": "invoke", "field": "as-br_table-index", "args": []}, "expected": []}, 60 {"type": "assert_return", "line": 266, "action": {"type": "invoke", "field": "as-br_table-value", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, 61 {"type": "assert_return", "line": 267, "action": {"type": "invoke", "field": "as-br_table-value-index", "args": []}, "expected": [{"type": "i32", "value": "6"}]}, 62 {"type": "assert_return", "line": 269, "action": {"type": "invoke", "field": "as-return-value", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, 63 {"type": "assert_return", "line": 271, "action": {"type": "invoke", "field": "as-if-cond", "args": []}, "expected": [{"type": "i32", "value": "0"}]}, 64 {"type": "assert_return", "line": 272, "action": {"type": "invoke", "field": "as-if-then", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, 65 {"type": "assert_return", "line": 273, "action": {"type": "invoke", "field": "as-if-else", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, 66 {"type": "assert_return", "line": 275, "action": {"type": "invoke", "field": "as-select-first", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "1"}]}, "expected": [{"type": "i32", "value": "1"}]}, 67 {"type": "assert_return", "line": 276, "action": {"type": "invoke", "field": "as-select-second", "args": [{"type": "i32", "value": "0"}, {"type": "i32", "value": "0"}]}, "expected": [{"type": "i32", "value": "1"}]}, 68 {"type": "assert_return", "line": 277, "action": {"type": "invoke", "field": "as-select-cond", "args": []}, "expected": [{"type": "i32", "value": "0"}]}, 69 {"type": "assert_return", "line": 279, "action": {"type": "invoke", "field": "as-call-first", "args": []}, "expected": [{"type": "i32", "value": "4294967295"}]}, 70 {"type": "assert_return", "line": 280, "action": {"type": "invoke", "field": "as-call-mid", "args": []}, "expected": [{"type": "i32", "value": "4294967295"}]}, 71 {"type": "assert_return", "line": 281, "action": {"type": "invoke", "field": "as-call-last", "args": []}, "expected": [{"type": "i32", "value": "4294967295"}]}, 72 {"type": "assert_return", "line": 283, "action": {"type": "invoke", "field": "as-call_indirect-first", "args": []}, "expected": [{"type": "i32", "value": "4294967295"}]}, 73 {"type": "assert_return", "line": 284, "action": {"type": "invoke", "field": "as-call_indirect-mid", "args": []}, "expected": [{"type": "i32", "value": "4294967295"}]}, 74 {"type": "assert_return", "line": 285, "action": {"type": "invoke", "field": "as-call_indirect-last", "args": []}, "expected": [{"type": "i32", "value": "4294967295"}]}, 75 {"type": "assert_trap", "line": 286, "action": {"type": "invoke", "field": "as-call_indirect-index", "args": []}, "text": "undefined element", "expected": [{"type": "i32"}]}, 76 {"type": "assert_return", "line": 288, "action": {"type": "invoke", "field": "as-local.set-value", "args": []}, "expected": []}, 77 {"type": "assert_return", "line": 289, "action": {"type": "invoke", "field": "as-local.tee-value", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, 78 {"type": "assert_return", "line": 290, "action": {"type": "invoke", "field": "as-global.set-value", "args": []}, "expected": []}, 79 {"type": "assert_return", "line": 292, "action": {"type": "invoke", "field": "as-load-address", "args": []}, "expected": [{"type": "i32", "value": "0"}]}, 80 {"type": "assert_return", "line": 293, "action": {"type": "invoke", "field": "as-loadN-address", "args": []}, "expected": [{"type": "i32", "value": "0"}]}, 81 {"type": "assert_return", "line": 294, "action": {"type": "invoke", "field": "as-store-address", "args": []}, "expected": []}, 82 {"type": "assert_return", "line": 295, "action": {"type": "invoke", "field": "as-store-value", "args": []}, "expected": []}, 83 {"type": "assert_return", "line": 296, "action": {"type": "invoke", "field": "as-storeN-address", "args": []}, "expected": []}, 84 {"type": "assert_return", "line": 297, "action": {"type": "invoke", "field": "as-storeN-value", "args": []}, "expected": []}, 85 {"type": "assert_return", "line": 299, "action": {"type": "invoke", "field": "as-unary-operand", "args": []}, "expected": [{"type": "i32", "value": "31"}]}, 86 {"type": "assert_return", "line": 301, "action": {"type": "invoke", "field": "as-binary-left", "args": []}, "expected": [{"type": "i32", "value": "11"}]}, 87 {"type": "assert_return", "line": 302, "action": {"type": "invoke", "field": "as-binary-right", "args": []}, "expected": [{"type": "i32", "value": "9"}]}, 88 {"type": "assert_return", "line": 304, "action": {"type": "invoke", "field": "as-test-operand", "args": []}, "expected": [{"type": "i32", "value": "0"}]}, 89 {"type": "assert_return", "line": 306, "action": {"type": "invoke", "field": "as-compare-left", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, 90 {"type": "assert_return", "line": 307, "action": {"type": "invoke", "field": "as-compare-right", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, 91 {"type": "assert_return", "line": 309, "action": {"type": "invoke", "field": "as-memory.grow-size", "args": []}, "expected": [{"type": "i32", "value": "1"}]}, 92 {"type": "assert_invalid", "line": 313, "filename": "memory_grow.5.wasm", "text": "type mismatch", "module_type": "binary"}, 93 {"type": "assert_invalid", "line": 322, "filename": "memory_grow.6.wasm", "text": "type mismatch", "module_type": "binary"}, 94 {"type": "assert_invalid", "line": 332, "filename": "memory_grow.7.wasm", "text": "type mismatch", "module_type": "binary"}, 95 {"type": "assert_invalid", "line": 342, "filename": "memory_grow.8.wasm", "text": "type mismatch", "module_type": "binary"}, 96 {"type": "assert_invalid", "line": 355, "filename": "memory_grow.9.wasm", "text": "type mismatch", "module_type": "binary"}]}