Files: 8fc026b2a62edac0dd238380f77dfa98fb0e5b33 / tests / wast / get_gas_budget.wast
1467 bytesRaw
1 | (module |
2 | (import "test" "check" (func $check (param i32 i32))) |
3 | (import "test" "print" (func $print (param i32))) |
4 | (import "func" "internalize" (func $func.internalize (param i32 i32))) |
5 | (import "func" "set_gas_budget" (func $func.set_gas_budget (param i32 i32) (result i32))) |
6 | (import "func" "get_gas_budget" (func $func.get_gas_budget (param i32) (result i32))) |
7 | (import "module" "self" (func $self (result i32))) |
8 | (import "module" "export" (func $exports (param i32 i32) (result i32))) |
9 | (import "memory" "externalize" (func $mem.externalize (param i32 i32) (result i32))) |
10 | (memory (export "memory") 1) |
11 | (data (i32.const 0) "callback") |
12 | (table (export "table") 1 1 anyfunc) |
13 | (func $main |
14 | (local $export_name i32) |
15 | (local $func_ref i32) |
16 | (call $func.internalize |
17 | (i32.const 0) |
18 | (tee_local $func_ref |
19 | (call $func.set_gas_budget |
20 | (call $exports |
21 | (call $self) |
22 | (tee_local $export_name |
23 | (call $mem.externalize (i32.const 0) (i32.const 8)))) |
24 | (i32.const 1000)))) |
25 | |
26 | (call $check |
27 | (i32.const 1000) |
28 | (call $func.get_gas_budget (get_local $func_ref))) |
29 | |
30 | (call_indirect (param i64 i32) |
31 | (i64.const 8) |
32 | (get_local $export_name) |
33 | (i32.const 0))) |
34 | |
35 | (func $callback (param i64) (param i32) |
36 | (call $check |
37 | (i32.const 8) |
38 | (i32.wrap/i64 (get_local 0))) |
39 | (call $print (get_local 1))) |
40 | (export "main" (func $main)) |
41 | (export "callback" (func $callback))) |
42 |
Built with git-ssb-web