MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / test_many_results

Function test_many_results

tests/all/component_model/func.rs:1122–1547  ·  view source on GitHub ↗
(dynamic: bool, concurrent: bool)

Source from the content-addressed store, hash-verified

1120}
1121
1122async fn test_many_results(dynamic: bool, concurrent: bool) -> Result<()> {
1123 let (ret, async_opts) = if concurrent {
1124 (
1125 r#"
1126 call $task-return
1127 i32.const 0
1128 "#,
1129 r#"async (callback (func $i "callback"))"#,
1130 )
1131 } else {
1132 ("", "")
1133 };
1134
1135 let my_nan = CANON_32BIT_NAN | 1;
1136
1137 let component = format!(
1138 r#"(component
1139 (core module $libc
1140 (memory (export "memory") 1)
1141
1142 {REALLOC_AND_FREE}
1143 )
1144 (core instance $libc (instantiate $libc))
1145 (core module $m
1146 (import "libc" "memory" (memory 1))
1147 (import "libc" "realloc" (func $realloc (param i32 i32 i32 i32) (result i32)))
1148 (import "" "task.return" (func $task-return (param i32)))
1149 (func (export "foo") (result i32)
1150 (local $base i32)
1151 (local $string i32)
1152 (local $list i32)
1153
1154 (local.set $base
1155 (call $realloc
1156 (i32.const 0)
1157 (i32.const 0)
1158 (i32.const 8)
1159 (i32.const 72)))
1160
1161 (i32.store8 offset=0
1162 (local.get $base)
1163 (i32.const -100))
1164
1165 (i64.store offset=8
1166 (local.get $base)
1167 (i64.const 9223372036854775807))
1168
1169 (f32.store offset=16
1170 (local.get $base)
1171 (f32.reinterpret_i32 (i32.const {my_nan})))
1172
1173 (i32.store8 offset=20
1174 (local.get $base)
1175 (i32.const 38))
1176
1177 (i32.store16 offset=22
1178 (local.get $base)
1179 (i32.const 18831))

Callers 4

many_resultsFunction · 0.85
many_results_concurrentFunction · 0.85
many_results_dynamicFunction · 0.85

Calls 14

OkFunction · 0.85
run_concurrentMethod · 0.80
call_concurrentMethod · 0.80
collectMethod · 0.80
newFunction · 0.50
instantiate_asyncMethod · 0.45
to_stringMethod · 0.45
unwrapMethod · 0.45
get_funcMethod · 0.45
call_asyncMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected