+ some basic tests for WebAssembly funcref types added

This commit is contained in:
Nikolay Nikolov 2023-06-11 04:27:05 +03:00
parent 8b138aa059
commit fcd5ecfcce
2 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,34 @@
{ %cpu=wasm32 }
{ %norun }
program twasmfuncref1;
{$MODE fpc}
type
TWasmFuncRef = function(a: longint; b: int64): longint; WasmFuncRef;
procedure testproc;
var
p: TWasmFuncRef;
begin
end;
procedure testproc2(q: TWasmFuncRef);
begin
end;
function testproc3: TWasmFuncRef;
begin
end;
function testproc4(a, b, c: longint; d: TWasmFuncRef; e: int64): TWasmFuncRef;
var
q: TWasmFuncRef;
begin
q := d;
testproc4 := q;
end;
begin
end.

View File

@ -0,0 +1,34 @@
{ %cpu=wasm32 }
{ %norun }
program twasmfuncref1;
{$MODE tp}
type
TWasmFuncRef = function(a: longint; b: int64): longint; WasmFuncRef;
procedure testproc;
var
p: TWasmFuncRef;
begin
end;
procedure testproc2(q: TWasmFuncRef);
begin
end;
function testproc3: TWasmFuncRef;
begin
end;
function testproc4(a, b, c: longint; d: TWasmFuncRef; e: int64): TWasmFuncRef;
var
q: TWasmFuncRef;
begin
q := d;
testproc4 := q;
end;
begin
end.