mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 04:29:20 +02:00
+ also test that pointers cannot be converted to externref implicitly
This commit is contained in:
parent
a47a1c093a
commit
7abe3eeb84
@ -8,7 +8,7 @@ var
|
|||||||
p: WasmExternRef;
|
p: WasmExternRef;
|
||||||
q: Pointer;
|
q: Pointer;
|
||||||
begin
|
begin
|
||||||
{ WasmExternRef cannot be converted to pointer }
|
{ WasmExternRef cannot be explicitly converted to pointer }
|
||||||
q := Pointer(p);
|
q := Pointer(p);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ var
|
|||||||
p: WasmExternRef;
|
p: WasmExternRef;
|
||||||
q: Pointer;
|
q: Pointer;
|
||||||
begin
|
begin
|
||||||
{ A pointer cannot be converted to WasmExternRef }
|
{ A pointer cannot be explicitly converted to WasmExternRef }
|
||||||
p := WasmExternRef(q);
|
p := WasmExternRef(q);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
16
tests/test/wasm/twasmexternref3b.pp
Normal file
16
tests/test/wasm/twasmexternref3b.pp
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{ %cpu=wasm32 }
|
||||||
|
{ %fail }
|
||||||
|
|
||||||
|
program twasmexternref3b;
|
||||||
|
|
||||||
|
procedure testproc;
|
||||||
|
var
|
||||||
|
p: WasmExternRef;
|
||||||
|
q: Pointer;
|
||||||
|
begin
|
||||||
|
{ WasmExternRef cannot be implicitly converted to pointer }
|
||||||
|
q := p;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
16
tests/test/wasm/twasmexternref3c.pp
Normal file
16
tests/test/wasm/twasmexternref3c.pp
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{ %cpu=wasm32 }
|
||||||
|
{ %fail }
|
||||||
|
|
||||||
|
program twasmexternref3c;
|
||||||
|
|
||||||
|
procedure testproc;
|
||||||
|
var
|
||||||
|
p: WasmExternRef;
|
||||||
|
q: Pointer;
|
||||||
|
begin
|
||||||
|
{ A pointer cannot be implicitly converted to WasmExternRef }
|
||||||
|
p := q;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user