(dynamic: bool, concurrent: bool)
| 835 | } |
| 836 | |
| 837 | async fn test_many_parameters(dynamic: bool, concurrent: bool) -> Result<()> { |
| 838 | let (body, async_opts) = if concurrent { |
| 839 | ( |
| 840 | r#" |
| 841 | (call $task-return |
| 842 | (i32.const 0) |
| 843 | (i32.mul |
| 844 | (memory.size) |
| 845 | (i32.const 65536) |
| 846 | ) |
| 847 | (local.get 0) |
| 848 | ) |
| 849 | |
| 850 | (i32.const 0) |
| 851 | "#, |
| 852 | r#"async (callback (func $i "callback"))"#, |
| 853 | ) |
| 854 | } else { |
| 855 | ( |
| 856 | r#" |
| 857 | (local $base i32) |
| 858 | |
| 859 | ;; Allocate space for the return |
| 860 | (local.set $base |
| 861 | (call $realloc |
| 862 | (i32.const 0) |
| 863 | (i32.const 0) |
| 864 | (i32.const 4) |
| 865 | (i32.const 12))) |
| 866 | |
| 867 | ;; Store the pointer/length of the entire linear memory |
| 868 | ;; so we have access to everything. |
| 869 | (i32.store offset=0 |
| 870 | (local.get $base) |
| 871 | (i32.const 0)) |
| 872 | (i32.store offset=4 |
| 873 | (local.get $base) |
| 874 | (i32.mul |
| 875 | (memory.size) |
| 876 | (i32.const 65536))) |
| 877 | |
| 878 | ;; And also store our pointer parameter |
| 879 | (i32.store offset=8 |
| 880 | (local.get $base) |
| 881 | (local.get 0)) |
| 882 | |
| 883 | (local.get $base) |
| 884 | "#, |
| 885 | "", |
| 886 | ) |
| 887 | }; |
| 888 | |
| 889 | let component = format!( |
| 890 | r#"(component |
| 891 | (core module $libc |
| 892 | (memory (export "memory") 1) |
| 893 | |
| 894 | {REALLOC_AND_FREE} |
no test coverage detected