mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-06 21:50:30 +02:00
Merged revision(s) 43114-43115, 46943 from trunk:
* fix for Mantis #36121: define FPC_ISO and FPC_EXTENDEDPASCAL for modes ISO and EXTENDEDPASCAL respectively ........ + add tests to check for correct definition of the FPC_* mode defines ........ * according to ISO 10206 (Extended Pascal) 6.9.3.5 the "otherwise"-clause is supported for case-statements + added test ........ git-svn-id: branches/fixes_3_2@47594 -
This commit is contained in:
parent
c74237421b
commit
4dca62b568
8
.gitattributes
vendored
8
.gitattributes
vendored
@ -12871,6 +12871,13 @@ tests/tbs/tb0654.pp svneol=native#text/plain
|
||||
tests/tbs/tb0655.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0656.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0657.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0659a.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0659b.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0659c.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0659d.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0659e.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0659f.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0659g.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0665.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0666a.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0666b.pp svneol=native#text/pascal
|
||||
@ -14043,6 +14050,7 @@ tests/test/tcase47_2.pp svneol=native#text/pascal
|
||||
tests/test/tcase48.pp svneol=native#text/pascal
|
||||
tests/test/tcase48_2.pp svneol=native#text/pascal
|
||||
tests/test/tcase5.pp svneol=native#text/pascal
|
||||
tests/test/tcase50.pp svneol=native#text/pascal
|
||||
tests/test/tcase6.pp svneol=native#text/pascal
|
||||
tests/test/tcase7.pp svneol=native#text/pascal
|
||||
tests/test/tcase8.pp svneol=native#text/pascal
|
||||
|
@ -611,7 +611,11 @@ implementation
|
||||
undef_system_macro('FPC_GPC')
|
||||
{$endif}
|
||||
else if (m_mac in oldmodeswitches) then
|
||||
undef_system_macro('FPC_MACPAS');
|
||||
undef_system_macro('FPC_MACPAS')
|
||||
else if (m_iso in oldmodeswitches) then
|
||||
undef_system_macro('FPC_ISO')
|
||||
else if (m_extpas in oldmodeswitches) then
|
||||
undef_system_macro('FPC_EXTENDEDPASCAL');
|
||||
|
||||
{ define new symbol in delphi,objfpc,tp,gpc,macpas mode }
|
||||
if (m_delphi in current_settings.modeswitches) then
|
||||
@ -625,7 +629,11 @@ implementation
|
||||
def_system_macro('FPC_GPC')
|
||||
{$endif}
|
||||
else if (m_mac in current_settings.modeswitches) then
|
||||
def_system_macro('FPC_MACPAS');
|
||||
def_system_macro('FPC_MACPAS')
|
||||
else if (m_iso in current_settings.modeswitches) then
|
||||
def_system_macro('FPC_ISO')
|
||||
else if (m_extpas in current_settings.modeswitches) then
|
||||
def_system_macro('FPC_EXTENDEDPASCAL');
|
||||
end;
|
||||
|
||||
SetCompileMode:=b;
|
||||
|
@ -608,7 +608,7 @@ const
|
||||
(str:'LOGICALOR' ;special:false;keyword:[m_none];op:NOTOKEN), { delphi operator name }
|
||||
(str:'NODEFAULT' ;special:false;keyword:[m_none];op:NOTOKEN),
|
||||
(str:'OBJCCLASS' ;special:false;keyword:[m_objectivec1];op:NOTOKEN),
|
||||
(str:'OTHERWISE' ;special:false;keyword:alllanguagemodes-[m_iso,m_extpas];op:NOTOKEN),
|
||||
(str:'OTHERWISE' ;special:false;keyword:alllanguagemodes-[m_iso];op:NOTOKEN),
|
||||
(str:'PROCEDURE' ;special:false;keyword:alllanguagemodes;op:NOTOKEN),
|
||||
(str:'PROTECTED' ;special:false;keyword:[m_none];op:NOTOKEN),
|
||||
(str:'PUBLISHED' ;special:false;keyword:[m_none];op:NOTOKEN),
|
||||
|
25
tests/tbs/tb0659a.pp
Normal file
25
tests/tbs/tb0659a.pp
Normal file
@ -0,0 +1,25 @@
|
||||
program tb0659a;
|
||||
|
||||
{$mode fpc}
|
||||
|
||||
{$ifdef FPC_TP}
|
||||
{$fatal FPC_TP defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_OBJFPC}
|
||||
{$fatal FPC_OBJFPC defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_DELPHI}
|
||||
{$fatal FPC_DELPHI defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_MACPAS}
|
||||
{$fatal FPC_MACPAS defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_ISO}
|
||||
{$fatal FPC_ISO defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_EXTENDEDPASCAL}
|
||||
{$fatal FPC_EXTENDEDPASCAL defined}
|
||||
{$endif}
|
||||
|
||||
begin
|
||||
end.
|
25
tests/tbs/tb0659b.pp
Normal file
25
tests/tbs/tb0659b.pp
Normal file
@ -0,0 +1,25 @@
|
||||
program tb0659b;
|
||||
|
||||
{$mode tp}
|
||||
|
||||
{$ifndef FPC_TP}
|
||||
{$fatal FPC_TP not defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_OBJFPC}
|
||||
{$fatal FPC_OBJFPC defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_DELPHI}
|
||||
{$fatal FPC_DELPHI defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_MACPAS}
|
||||
{$fatal FPC_MACPAS defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_ISO}
|
||||
{$fatal FPC_ISO defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_EXTENDEDPASCAL}
|
||||
{$fatal FPC_EXTENDEDPASCAL defined}
|
||||
{$endif}
|
||||
|
||||
begin
|
||||
end.
|
25
tests/tbs/tb0659c.pp
Normal file
25
tests/tbs/tb0659c.pp
Normal file
@ -0,0 +1,25 @@
|
||||
program tb0659c;
|
||||
|
||||
{$mode objfpc}
|
||||
|
||||
{$ifdef FPC_TP}
|
||||
{$fatal FPC_TP defined}
|
||||
{$endif}
|
||||
{$ifndef FPC_OBJFPC}
|
||||
{$fatal FPC_OBJFPC not defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_DELPHI}
|
||||
{$fatal FPC_DELPHI defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_MACPAS}
|
||||
{$fatal FPC_MACPAS defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_ISO}
|
||||
{$fatal FPC_ISO defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_EXTENDEDPASCAL}
|
||||
{$fatal FPC_EXTENDEDPASCAL defined}
|
||||
{$endif}
|
||||
|
||||
begin
|
||||
end.
|
25
tests/tbs/tb0659d.pp
Normal file
25
tests/tbs/tb0659d.pp
Normal file
@ -0,0 +1,25 @@
|
||||
program tb0659d;
|
||||
|
||||
{$mode delphi}
|
||||
|
||||
{$ifdef FPC_TP}
|
||||
{$fatal FPC_TP defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_OBJFPC}
|
||||
{$fatal FPC_OBJFPC defined}
|
||||
{$endif}
|
||||
{$ifndef FPC_DELPHI}
|
||||
{$fatal FPC_DELPHI not defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_MACPAS}
|
||||
{$fatal FPC_MACPAS defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_ISO}
|
||||
{$fatal FPC_ISO defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_EXTENDEDPASCAL}
|
||||
{$fatal FPC_EXTENDEDPASCAL defined}
|
||||
{$endif}
|
||||
|
||||
begin
|
||||
end.
|
25
tests/tbs/tb0659e.pp
Normal file
25
tests/tbs/tb0659e.pp
Normal file
@ -0,0 +1,25 @@
|
||||
program tb0659e;
|
||||
|
||||
{$mode macpas}
|
||||
|
||||
{$ifdef FPC_TP}
|
||||
{$fatal FPC_TP defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_OBJFPC}
|
||||
{$fatal FPC_OBJFPC defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_DELPHI}
|
||||
{$fatal FPC_DELPHI defined}
|
||||
{$endif}
|
||||
{$ifndef FPC_MACPAS}
|
||||
{$fatal FPC_MACPAS not defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_ISO}
|
||||
{$fatal FPC_ISO defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_EXTENDEDPASCAL}
|
||||
{$fatal FPC_EXTENDEDPASCAL defined}
|
||||
{$endif}
|
||||
|
||||
begin
|
||||
end.
|
25
tests/tbs/tb0659f.pp
Normal file
25
tests/tbs/tb0659f.pp
Normal file
@ -0,0 +1,25 @@
|
||||
program tb0659f;
|
||||
|
||||
{$mode iso}
|
||||
|
||||
{$ifdef FPC_TP}
|
||||
{$fatal FPC_TP defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_OBJFPC}
|
||||
{$fatal FPC_OBJFPC defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_DELPHI}
|
||||
{$fatal FPC_DELPHI defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_MACPAS}
|
||||
{$fatal FPC_MACPAS defined}
|
||||
{$endif}
|
||||
{$ifndef FPC_ISO}
|
||||
{$fatal FPC_ISO not defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_EXTENDEDPASCAL}
|
||||
{$fatal FPC_EXTENDEDPASCAL defined}
|
||||
{$endif}
|
||||
|
||||
begin
|
||||
end.
|
25
tests/tbs/tb0659g.pp
Normal file
25
tests/tbs/tb0659g.pp
Normal file
@ -0,0 +1,25 @@
|
||||
program tb0659g;
|
||||
|
||||
{$mode extendedpascal}
|
||||
|
||||
{$ifdef FPC_TP}
|
||||
{$fatal FPC_TP defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_OBJFPC}
|
||||
{$fatal FPC_OBJFPC defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_DELPHI}
|
||||
{$fatal FPC_DELPHI defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_MACPAS}
|
||||
{$fatal FPC_MACPAS defined}
|
||||
{$endif}
|
||||
{$ifdef FPC_ISO}
|
||||
{$fatal FPC_ISO defined}
|
||||
{$endif}
|
||||
{$ifndef FPC_EXTENDEDPASCAL}
|
||||
{$fatal FPC_EXTENDEDPASCAL not defined}
|
||||
{$endif}
|
||||
|
||||
begin
|
||||
end.
|
12
tests/test/tcase50.pp
Normal file
12
tests/test/tcase50.pp
Normal file
@ -0,0 +1,12 @@
|
||||
{ %NORUN }
|
||||
|
||||
program tcase50;
|
||||
|
||||
{$mode ExtendedPascal}
|
||||
|
||||
begin
|
||||
case 5 of
|
||||
1, 2, 3: ;
|
||||
otherwise
|
||||
end;
|
||||
end.
|
Loading…
Reference in New Issue
Block a user