瀏覽代碼

+ tests for r43436

git-svn-id: trunk@43438 -
Jonas Maebe 5 年之前
父節點
當前提交
af97c43bdc
共有 4 個文件被更改,包括 48 次插入0 次删除
  1. 3 0
      .gitattributes
  2. 15 0
      tests/test/tinlrange1.pp
  3. 15 0
      tests/test/tinlrange2.pp
  4. 15 0
      tests/test/tinlrange3.pp

+ 3 - 0
.gitattributes

@@ -14719,6 +14719,9 @@ tests/test/tinline6.pp svneol=native#text/plain
 tests/test/tinline7.pp svneol=native#text/plain
 tests/test/tinline7.pp svneol=native#text/plain
 tests/test/tinline8.pp svneol=native#text/plain
 tests/test/tinline8.pp svneol=native#text/plain
 tests/test/tinline9.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/tint2str1.pp svneol=native#text/plain
 tests/test/tint2str2.pp svneol=native#text/plain
 tests/test/tint2str2.pp svneol=native#text/plain
 tests/test/tint641.pp svneol=native#text/plain
 tests/test/tint641.pp svneol=native#text/plain

+ 15 - 0
tests/test/tinlrange1.pp

@@ -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 - 0
tests/test/tinlrange2.pp

@@ -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 - 0
tests/test/tinlrange3.pp

@@ -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.