+ $A similiar to $align on/off added

git-svn-id: trunk@551 -
This commit is contained in:
florian 2005-07-01 18:49:55 +00:00
parent c581066998
commit 08f0419e3e
3 changed files with 82 additions and 42 deletions

1
.gitattributes vendored
View File

@ -5925,6 +5925,7 @@ tests/webtbs/tw3041.pp svneol=native#text/plain
tests/webtbs/tw3045.pp svneol=native#text/plain
tests/webtbs/tw3048.pp svneol=native#text/plain
tests/webtbs/tw3063.pp svneol=native#text/plain
tests/webtbs/tw3064.pp svneol=native#text/plain
tests/webtbs/tw3073.pp svneol=native#text/plain
tests/webtbs/tw3082.pp svneol=native#text/plain
tests/webtbs/tw3083.pp svneol=native#text/plain

View File

@ -39,7 +39,7 @@ uses
****************************************************************************}
type
TSwitchType=(ignoredsw,localsw,modulesw,globalsw,illegalsw,unsupportedsw);
TSwitchType=(ignoredsw,localsw,modulesw,globalsw,illegalsw,unsupportedsw,alignsw);
SwitchRec=record
typesw : TSwitchType;
setsw : byte;
@ -48,7 +48,7 @@ type
const
turboSwitchTable: SwitchRecTable =(
{A} (typesw:unsupportedsw; setsw:ord(cs_localnone)),
{A} (typesw:alignsw; setsw:ord(cs_localnone)),
{B} (typesw:localsw; setsw:ord(cs_full_boolean_eval)),
{C} (typesw:localsw; setsw:ord(cs_do_assertion)),
{D} (typesw:modulesw; setsw:ord(cs_debuginfo)),
@ -146,46 +146,57 @@ begin
with switchTablePtr^[switch] do
begin
case typesw of
ignoredsw : Message1(scan_n_ignored_switch,'$'+switch);
illegalsw : Message1(scan_w_illegal_switch,'$'+switch);
unsupportedsw : Message1(scan_w_unsupported_switch,'$'+switch);
localsw : begin
if not localswitcheschanged then
nextaktlocalswitches:=aktlocalswitches;
if state='+' then
include(nextaktlocalswitches,tlocalswitch(setsw))
else
exclude(nextaktlocalswitches,tlocalswitch(setsw));
localswitcheschanged:=true;
end;
modulesw : begin
if current_module.in_global then
begin
if state='+' then
include(aktmoduleswitches,tmoduleswitch(setsw))
else
begin
{ Turning off debuginfo when lineinfo is requested
is not possible }
if not((cs_gdb_lineinfo in aktglobalswitches) and
(tmoduleswitch(setsw)=cs_debuginfo)) then
exclude(aktmoduleswitches,tmoduleswitch(setsw));
end;
end
else
Message(scan_w_switch_is_global);
end;
globalsw : begin
if current_module.in_global and (current_module=main_module) then
begin
if state='+' then
include(aktglobalswitches,tglobalswitch(setsw))
else
exclude(aktglobalswitches,tglobalswitch(setsw));
end
else
Message(scan_w_switch_is_global);
end;
alignsw:
if state='+' then
aktpackrecords:=4
else
aktpackrecords:=1;
ignoredsw :
Message1(scan_n_ignored_switch,'$'+switch);
illegalsw :
Message1(scan_w_illegal_switch,'$'+switch);
unsupportedsw :
Message1(scan_w_unsupported_switch,'$'+switch);
localsw :
begin
if not localswitcheschanged then
nextaktlocalswitches:=aktlocalswitches;
if state='+' then
include(nextaktlocalswitches,tlocalswitch(setsw))
else
exclude(nextaktlocalswitches,tlocalswitch(setsw));
localswitcheschanged:=true;
end;
modulesw :
begin
if current_module.in_global then
begin
if state='+' then
include(aktmoduleswitches,tmoduleswitch(setsw))
else
begin
{ Turning off debuginfo when lineinfo is requested
is not possible }
if not((cs_gdb_lineinfo in aktglobalswitches) and
(tmoduleswitch(setsw)=cs_debuginfo)) then
exclude(aktmoduleswitches,tmoduleswitch(setsw));
end;
end
else
Message(scan_w_switch_is_global);
end;
globalsw :
begin
if current_module.in_global and (current_module=main_module) then
begin
if state='+' then
include(aktglobalswitches,tglobalswitch(setsw))
else
exclude(aktglobalswitches,tglobalswitch(setsw));
end
else
Message(scan_w_switch_is_global);
end;
end;
end;
end;

28
tests/webtbs/tw3064.pp Normal file
View File

@ -0,0 +1,28 @@
type
r1 = packed record
b : byte;
l : longint;
end;
r2 = record
b : byte;
l : longint;
end;
{$a-}
r3 = record
b : byte;
l : longint;
end;
{$a+}
r4 = record
b : byte;
l : longint;
end;
begin
if (sizeof(r1)<>sizeof(r3)) or (sizeof(r2)<>sizeof(r4)) then
halt(1);
writeln('ok');
end.