mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2026-01-07 16:00:39 +01:00
+ some basic tests for WebAssembly funcref types added
This commit is contained in:
parent
8b138aa059
commit
fcd5ecfcce
34
tests/test/wasm/twasmfuncref1.pp
Normal file
34
tests/test/wasm/twasmfuncref1.pp
Normal 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.
|
||||
34
tests/test/wasm/twasmfuncref1a.pp
Normal file
34
tests/test/wasm/twasmfuncref1a.pp
Normal 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.
|
||||
Loading…
Reference in New Issue
Block a user