This commit is contained in:
peter 2001-01-11 18:37:49 +00:00
parent e76640218c
commit db5f27934e
4 changed files with 134 additions and 0 deletions

10
tests/webtbs/tw1328.pp Normal file
View File

@ -0,0 +1,10 @@
{ %CPU=i386 }
{$asmmode intel}
begin
asm
movsx edx, edi
movsx eax, dword ptr [esi]
movzx edx, edi
movzx eax, dword ptr [esi]
end;
end.

51
tests/webtbs/tw1331.pp Normal file
View File

@ -0,0 +1,51 @@
program tw1331;
{$mode objfpc}
uses Classes, SysUtils, TypInfo, uw1331;
type
DummyEnum1 = (tr1,tr2);
DummyEnum2 = tr1..tr2;
DummyClass = class(TPersistent)
private
FMyDummyEnum1:DummyEnum1;
FMyDummyEnum2:DummyEnum2;
FMyDummyEnum3:DummyEnum3;
FMyDummyEnum4:DummyEnum4;
published
property MyDummyEnum1:DummyEnum1 read FMyDummyEnum1 write FMyDummyEnum1;
property MyDummyEnum2:DummyEnum2 read FMyDummyEnum2 write FMyDummyEnum2;
property MyDummyEnum3:DummyEnum3 read FMyDummyEnum3 write FMyDummyEnum3;
property MyDummyEnum4:DummyEnum4 read FMyDummyEnum4 write FMyDummyEnum4;
end;
var Dummy1:DummyClass;
List:PPropList;
Count,Index,I:integer;
EnumType:PTypeInfo;
begin
// create a dummyclass instance
Dummy1:=DummyClass.Create;
// get property list
Count:=GetTypeData(DummyClass.ClassInfo)^.Propcount;
GetMem(List,Count * SizeOf(Pointer));
GetPropInfos(DummyClass.ClassInfo,List);
Index:=Count-1;
while (Index>=0) do begin
EnumType:=List^[Index]^.PropType;
if EnumType^.Kind=tkEnumeration then begin
// print all enumeration types
writeln('PropertyName=',EnumType^.Name);
with GetTypeData(EnumType)^ do
// write all possible values for this type
for I := MinValue to MaxValue do
writeln(I,': ''',GetEnumName(EnumType, I),'''');
end;
dec(Index);
end;
FreeMem(List);
Dummy1.Free;
end.

58
tests/webtbs/tw1333.pp Normal file
View File

@ -0,0 +1,58 @@
uses
getopts;
function ParseCmdOptions : boolean;
var
Opts : array [1..3] of POption;
C : char;
Index : Longint;
begin
{ assume success }
ParseCmdOptions := true;
{ logfile }
New(Opts[1]);
with Opts[1]^ do
begin
name := 'log';
has_arg := 1;
flag := nil;
end;
{ debug flag }
New(Opts[2]);
with Opts[2]^ do
begin
name := 'debug';
has_arg := 0;
flag := nil;
end;
{ end-of-array }
New(Opts[3]);
with Opts[3]^ do
begin
name := '';
has_arg := 0;
flag := nil
end;
{ parse }
repeat
C := GetLongOpts('l:d',Opts[1],Index);
case C of
#0: begin
if Opts[Index]^.name = Opts[1]^.name then { .. };
if Opts[Index]^.name = Opts[2]^.name then { .. };
{ handle this properly -- else ParseCmdOptions := false; }
end;
'l': { .. };
'd': { .. };
else ParseCmdOptions := false;
end; { case }
until C = endofoptions;
end;
begin
end.

15
tests/webtbs/uw1331.pp Normal file
View File

@ -0,0 +1,15 @@
unit uw1331;
{$mode objfpc}
interface
uses Classes, SysUtils;
type
DummyEnum3 = (tr3,tr4);
DummyEnum4 = tr3..tr4;
implementation
end.