mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 20:39:28 +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;
|
||||
q: Pointer;
|
||||
begin
|
||||
{ WasmExternRef cannot be converted to pointer }
|
||||
{ WasmExternRef cannot be explicitly converted to pointer }
|
||||
q := Pointer(p);
|
||||
end;
|
||||
|
||||
|
@ -8,7 +8,7 @@ var
|
||||
p: WasmExternRef;
|
||||
q: Pointer;
|
||||
begin
|
||||
{ A pointer cannot be converted to WasmExternRef }
|
||||
{ A pointer cannot be explicitly converted to WasmExternRef }
|
||||
p := WasmExternRef(q);
|
||||
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