+ tests for r43436

git-svn-id: trunk@43438 -
This commit is contained in:
Jonas Maebe 2019-11-10 13:13:57 +00:00
parent d23c7980aa
commit af97c43bdc
4 changed files with 48 additions and 0 deletions

3
.gitattributes vendored
View File

@ -14719,6 +14719,9 @@ tests/test/tinline6.pp svneol=native#text/plain
tests/test/tinline7.pp svneol=native#text/plain
tests/test/tinline8.pp svneol=native#text/plain
tests/test/tinline9.pp svneol=native#text/plain
tests/test/tinlrange1.pp svneol=native#text/plain
tests/test/tinlrange2.pp svneol=native#text/plain
tests/test/tinlrange3.pp svneol=native#text/plain
tests/test/tint2str1.pp svneol=native#text/plain
tests/test/tint2str2.pp svneol=native#text/plain
tests/test/tint641.pp svneol=native#text/plain

15
tests/test/tinlrange1.pp Normal file
View File

@ -0,0 +1,15 @@
{ %fail }
{$mode objfpc}
{$r+}
function test(l1, l2: longint): longint; inline;
begin
result:=l1+l2;
end;
{ range checking state at caller site should not influence inline evaluation }
{$r-}
begin
test(high(longint), 1);
end.

15
tests/test/tinlrange2.pp Normal file
View File

@ -0,0 +1,15 @@
{ %norun }
{$mode objfpc}
{$r-}
function test(l1, l2: longint): longint; inline;
begin
result:=l1+l2;
end;
{ range checking state at caller site should not influence inline evaluation }
{$r+}
begin
test(high(longint), 1);
end.

15
tests/test/tinlrange3.pp Normal file
View File

@ -0,0 +1,15 @@
{ %fail }
{$mode objfpc}
{$q+}
function test(l1, l2: int64): int64; inline;
begin
result:=l1+l2;
end;
{$q-}
begin
test(high(int64), 1);
end.