From 3396e2e1f42bc33b08a4923fd15423cad4db2c09 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 22 Mar 2015 10:20:37 +0000 Subject: [PATCH] * interpret -daaa:=bbb after -Sm was passed as a macro definition, resolves #27529 git-svn-id: trunk@30271 - --- .gitattributes | 1 + compiler/options.pas | 7 ++++++- tests/webtbs/tw27529.pp | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 tests/webtbs/tw27529.pp diff --git a/.gitattributes b/.gitattributes index 29de4d7ba3..c00b210eda 100644 --- a/.gitattributes +++ b/.gitattributes @@ -14330,6 +14330,7 @@ tests/webtbs/tw2738.pp svneol=native#text/plain tests/webtbs/tw2739.pp svneol=native#text/plain tests/webtbs/tw27424.pp svneol=native#text/pascal tests/webtbs/tw27515.pp svneol=native#text/pascal +tests/webtbs/tw27529.pp svneol=native#text/pascal tests/webtbs/tw2758.pp svneol=native#text/plain tests/webtbs/tw2763.pp svneol=native#text/plain tests/webtbs/tw27634.pp svneol=native#text/plain diff --git a/compiler/options.pas b/compiler/options.pas index ce26743cb8..c8f8bf6fcd 100644 --- a/compiler/options.pas +++ b/compiler/options.pas @@ -1349,7 +1349,12 @@ begin StopOptions(1); end; if l>0 then - set_system_compvar(hs,Copy(more,l+2,255)) + begin + if cs_support_macro in init_settings.moduleswitches then + set_system_macro(hs,Copy(more,l+2,255)) + else + set_system_compvar(hs,Copy(more,l+2,255)); + end else def_system_macro(hs); end; diff --git a/tests/webtbs/tw27529.pp b/tests/webtbs/tw27529.pp new file mode 100644 index 0000000000..9a4bfec571 --- /dev/null +++ b/tests/webtbs/tw27529.pp @@ -0,0 +1,17 @@ +{ %OPT=-Sm -dMY_VAR:=123 } +program test; + +{$IF DEFINED(MY_VAR)} + {$INFO MY_VAR defined} + {$IF MY_VAR=123} + {$INFO MY_VAR = 123} + {$ELSE} + {$INFO MY_VAR <> 123} + {$ENDIF} +{$ENDIF} + +begin + writeln(MY_VAR); + if MY_VAR<>123 then + halt(1); +end.