Files: 8fc026b2a62edac0dd238380f77dfa98fb0e5b33 / tests / wast / storage.wast
1249 bytesRaw
1 | (module |
2 | (import "test" "check" (func $check (param i32 i32))) |
3 | (import "test" "print" (func $print (param i32))) |
4 | (import "memory" "externalize" (func $mem.externalize (param i32 i32) (result i32))) |
5 | (import "storage" "get" (func $storage.get (result i32))) |
6 | (import "storage" "set" (func $storage.set (param i32))) |
7 | (import "elem" "externalize" (func $elem.externalize (param i32 i32) (result i32))) |
8 | (import "elem" "internalize" (func $elem.internalize (param i32 i32 i32 i32))) |
9 | (import "func" "internalize" (func $func.internalize (param i32 i32))) |
10 | |
11 | (memory (export "memory") 1) |
12 | (data (i32.const 0) "hello world") |
13 | (table (export "table") 1 1 anyfunc) |
14 | (func $main |
15 | (i32.store |
16 | (i32.const 0) |
17 | (call $mem.externalize (i32.const 0) (i32.const 11))) |
18 | |
19 | (call $storage.set |
20 | (call $elem.externalize (i32.const 0) (i32.const 1)))) |
21 | |
22 | (func $load (param $egress i32) |
23 | (call $elem.internalize |
24 | (i32.const 0) |
25 | (i32.const 1) |
26 | (call $storage.get) |
27 | (i32.const 0)) |
28 | |
29 | (call $func.internalize |
30 | (i32.const 0) |
31 | (get_local $egress)) |
32 | |
33 | (call_indirect (param i32) |
34 | (i32.load (i32.const 0)) |
35 | (i32.const 0))) |
36 | |
37 | (export "main" (func $main)) |
38 | (export "load" (func $load))) |
39 |
Built with git-ssb-web