diff --git a/.gitattributes b/.gitattributes index 6350c3fd45..8947bea54b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -15013,6 +15013,8 @@ tests/webtbs/tw29958.pp svneol=native#text/pascal tests/webtbs/tw2998.pp svneol=native#text/plain tests/webtbs/tw2999.pp svneol=native#text/plain tests/webtbs/tw29992.pp svneol=native#text/plain +tests/webtbs/tw30035.pp svneol=native#text/plain +tests/webtbs/tw30035a.pp svneol=native#text/plain tests/webtbs/tw3004.pp svneol=native#text/plain tests/webtbs/tw3005.pp svneol=native#text/plain tests/webtbs/tw3010.pp svneol=native#text/plain diff --git a/compiler/powerpc/nppcadd.pas b/compiler/powerpc/nppcadd.pas index e03910da28..055e530afd 100644 --- a/compiler/powerpc/nppcadd.pas +++ b/compiler/powerpc/nppcadd.pas @@ -485,7 +485,8 @@ interface end else begin - if is_signed(resultdef) then + if is_signed(left.resultdef) and + is_signed(right.resultdef) then begin case nodetype of addn: diff --git a/tests/webtbs/tw30035.pp b/tests/webtbs/tw30035.pp new file mode 100644 index 0000000000..8eb8fc06e2 --- /dev/null +++ b/tests/webtbs/tw30035.pp @@ -0,0 +1,14 @@ +var + i64: Int64; + qa, qb: DWord; +begin + qa := 2147483648; + qb := 536870912; +{$R-}{$Q-} + i64 := int64(qa) * int64(qb); + if i64 <> 1152921504606846976 then + begin + Writeln('Error!'); + Halt(1); + end; +end. diff --git a/tests/webtbs/tw30035a.pp b/tests/webtbs/tw30035a.pp new file mode 100644 index 0000000000..58dcc02f2c --- /dev/null +++ b/tests/webtbs/tw30035a.pp @@ -0,0 +1,14 @@ +var + i64: Int64; + qa, qb: DWord; +begin + qa := 2147483648; + qb := 536870912; +{$R+}{$Q+} + i64 := int64(qa) * int64(qb); + if i64 <> 1152921504606846976 then + begin + Writeln('Error!'); + Halt(1); + end; +end.