diff --git a/.gitattributes b/.gitattributes
index a90abf3364..1d73c345e1 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -11846,6 +11846,7 @@ tests/webtbs/tw1932.pp svneol=native#text/plain
 tests/webtbs/tw19325.pp svneol=native#text/pascal
 tests/webtbs/tw1935.pp svneol=native#text/plain
 tests/webtbs/tw1936.pp svneol=native#text/plain
+tests/webtbs/tw19368.pp svneol=native#text/pascal
 tests/webtbs/tw1938.pp svneol=native#text/plain
 tests/webtbs/tw1948.pp svneol=native#text/plain
 tests/webtbs/tw1950.pp svneol=native#text/plain
diff --git a/tests/webtbs/tw19368.pp b/tests/webtbs/tw19368.pp
new file mode 100644
index 0000000000..1e75c1957b
--- /dev/null
+++ b/tests/webtbs/tw19368.pp
@@ -0,0 +1,43 @@
+program Test5_FloatToStr_2Times;
+
+{$mode objfpc}{$H+}
+
+uses
+  SysUtils, Math;
+
+const
+  first_passed : boolean = false;
+  second_passed : boolean = false;
+
+Procedure ExitProg;
+begin
+  if first_passed <> second_passed then
+    begin
+      Writeln('Error ',ExitCode,' after first passed!');
+    end
+  else if (ExitCode<>0) then
+    begin
+      Writeln('Exit code: ',ExitCode);
+      if (ExitCode=217) and not first_passed then
+        begin
+          Writeln('FPU error appeared at first call to FloatToStr(NaN)');
+          Writeln('This is OK, it just means that sysutils.FloatToStr');
+          Writeln('doesn''t support NaNs.');
+          Writeln('Test considered successful.');
+          ExitCode:=0;
+        end;
+    end;
+end;
+
+var
+  s,s1: string;
+
+begin
+  ExitProc:=@ExitProg;
+  Writeln('1: ',NaN);
+  Writeln('2: ',NaN);
+  Writeln('1 with FloatToStr: ',FloatToStr(NaN));
+  first_passed:=true;
+  Writeln('2 with FloatToStr: ',FloatToStr(NaN));
+  second_passed:=true;
+end.