mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 16:29:21 +02:00
* extra test for tw3395
This commit is contained in:
parent
59052a64b9
commit
e2c6259fcf
29
tests/webtbf/tw3395a.pp
Normal file
29
tests/webtbf/tw3395a.pp
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{ %fail }
|
||||||
|
|
||||||
|
{$mode delphi}
|
||||||
|
|
||||||
|
type
|
||||||
|
texec1 = class
|
||||||
|
protected
|
||||||
|
procedure execute;
|
||||||
|
public
|
||||||
|
constructor create;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure t(p: pointer);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor texec1.Create;
|
||||||
|
begin
|
||||||
|
// This should give an invalid typecast, because a methodpointer are 2 pointers
|
||||||
|
t(pointer(execute));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure texec1.execute;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
||||||
|
|
@ -1,29 +0,0 @@
|
|||||||
program bug3395;
|
|
||||||
|
|
||||||
{$MODE DELPHI}
|
|
||||||
{$THREADING ON}
|
|
||||||
|
|
||||||
type
|
|
||||||
texec1 = class
|
|
||||||
protected
|
|
||||||
procedure execute;
|
|
||||||
public
|
|
||||||
constructor create;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure t(p: pointer);
|
|
||||||
begin
|
|
||||||
end;
|
|
||||||
|
|
||||||
constructor texec1.Create;
|
|
||||||
begin
|
|
||||||
t(@execute);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure texec1.execute;
|
|
||||||
begin
|
|
||||||
end;
|
|
||||||
|
|
||||||
begin
|
|
||||||
end.
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user