mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 03:09:11 +02:00
* delphi tests from Thomas mail
This commit is contained in:
parent
2b1d92cb5c
commit
efa4fa2ce4
6
tests/tbf/tbf0323.pp
Normal file
6
tests/tbf/tbf0323.pp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{$ifdef fpc}{$mode delphi}{$endif}
|
||||||
|
type
|
||||||
|
TA = (aOne := 1, aTwo, aThree, aFour, aSix);
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
10
tests/tbf/tbf0324.pp
Normal file
10
tests/tbf/tbf0324.pp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{$ifdef fpc}{$mode delphi}{$endif}
|
||||||
|
|
||||||
|
function k2:longint;
|
||||||
|
var
|
||||||
|
result : word;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
14
tests/tbf/tbf0325.pp
Normal file
14
tests/tbf/tbf0325.pp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{$ifdef fpc}{$mode delphi}{$endif}
|
||||||
|
|
||||||
|
function k2(result:word):longint;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
function k3(l:word):longint;
|
||||||
|
var
|
||||||
|
result : word;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
6
tests/tbf/tbf0326.pp
Normal file
6
tests/tbf/tbf0326.pp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{$mode delphi}
|
||||||
|
const
|
||||||
|
anyconst = %11111;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
21
tests/tbf/tbf0328.pp
Normal file
21
tests/tbf/tbf0328.pp
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{$ifdef fpc}{$mode delphi}{$endif}
|
||||||
|
|
||||||
|
procedure k1(l:longint);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure k1(l:string);overload;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure k2(l:longint);overload;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure k2(l:string);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
12
tests/tbs/tbs0327.pp
Normal file
12
tests/tbs/tbs0327.pp
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{$ifdef fpc}{$mode delphi}{$endif}
|
||||||
|
|
||||||
|
procedure k(l:longint);overload;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure k(l:string);overload;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
61
tests/tbs/tbs0329.pp
Normal file
61
tests/tbs/tbs0329.pp
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
{$packrecords c}
|
||||||
|
|
||||||
|
type
|
||||||
|
SHORT=smallint;
|
||||||
|
WINBOOL = longbool;
|
||||||
|
WCHAR=word;
|
||||||
|
UINT=cardinal;
|
||||||
|
|
||||||
|
COORD = record
|
||||||
|
X : SHORT;
|
||||||
|
Y : SHORT;
|
||||||
|
end;
|
||||||
|
|
||||||
|
KEY_EVENT_RECORD = packed record
|
||||||
|
bKeyDown : WINBOOL;
|
||||||
|
wRepeatCount : WORD;
|
||||||
|
wVirtualKeyCode : WORD;
|
||||||
|
wVirtualScanCode : WORD;
|
||||||
|
case longint of
|
||||||
|
0 : ( UnicodeChar : WCHAR;
|
||||||
|
dwControlKeyState : DWORD; );
|
||||||
|
1 : ( AsciiChar : CHAR );
|
||||||
|
end;
|
||||||
|
|
||||||
|
MOUSE_EVENT_RECORD = record
|
||||||
|
dwMousePosition : COORD;
|
||||||
|
dwButtonState : DWORD;
|
||||||
|
dwControlKeyState : DWORD;
|
||||||
|
dwEventFlags : DWORD;
|
||||||
|
end;
|
||||||
|
|
||||||
|
WINDOW_BUFFER_SIZE_RECORD = record
|
||||||
|
dwSize : COORD;
|
||||||
|
end;
|
||||||
|
|
||||||
|
MENU_EVENT_RECORD = record
|
||||||
|
dwCommandId : UINT;
|
||||||
|
end;
|
||||||
|
|
||||||
|
FOCUS_EVENT_RECORD = record
|
||||||
|
bSetFocus : WINBOOL;
|
||||||
|
end;
|
||||||
|
|
||||||
|
INPUT_RECORD = record
|
||||||
|
EventType : WORD;
|
||||||
|
case longint of
|
||||||
|
0 : ( KeyEvent : KEY_EVENT_RECORD );
|
||||||
|
1 : ( MouseEvent : MOUSE_EVENT_RECORD );
|
||||||
|
2 : ( WindowBufferSizeEvent : WINDOW_BUFFER_SIZE_RECORD );
|
||||||
|
3 : ( MenuEvent : MENU_EVENT_RECORD );
|
||||||
|
4 : ( FocusEvent : FOCUS_EVENT_RECORD );
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
if sizeof(INPUT_RECORD)<>20 then
|
||||||
|
begin
|
||||||
|
writeln('Wrong packing for Packrecords C and union ',sizeof(INPUT_RECORD),' instead of ',20);
|
||||||
|
halt(1);
|
||||||
|
end;
|
||||||
|
end.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user