diff --git a/.gitattributes b/.gitattributes
index 1c10d2422f..361dee9779 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -15410,6 +15410,7 @@ tests/webtbs/tw31421a.pp svneol=native#text/plain
 tests/webtbs/tw3143.pp svneol=native#text/plain
 tests/webtbs/tw31431.pp svneol=native#text/pascal
 tests/webtbs/tw3144.pp svneol=native#text/plain
+tests/webtbs/tw31521.pp svneol=native#text/pascal
 tests/webtbs/tw3157.pp svneol=native#text/plain
 tests/webtbs/tw31596.pp svneol=native#text/pascal
 tests/webtbs/tw3160a.pp svneol=native#text/plain
diff --git a/tests/webtbs/tw31521.pp b/tests/webtbs/tw31521.pp
new file mode 100644
index 0000000000..bc94d2af88
--- /dev/null
+++ b/tests/webtbs/tw31521.pp
@@ -0,0 +1,15 @@
+program tw31521;
+
+{$mode delphi}
+
+uses SysUtils;
+
+var
+  X: Int64;
+begin
+  if X.MaxValue <> High(X) then
+    Halt(1);
+  {Writeln(X.MaxValue.ToString);
+  Writeln(IntToStr(High(X)));
+  Readln;}
+end.