Просмотр исходного кода

+ test tw3967.pp

git-svn-id: trunk@40 -
florian 20 лет назад
Родитель
Сommit
ae4ac3d4da
2 измененных файлов с 24 добавлено и 0 удалено
  1. 1 0
      .gitattributes
  2. 23 0
      tests/webtbs/tw3967.pp

+ 1 - 0
.gitattributes

@@ -6101,6 +6101,7 @@ tests/webtbs/tw3899.pp svneol=native#text/plain
 tests/webtbs/tw3900.pp svneol=native#text/plain
 tests/webtbs/tw3953a.pp svneol=native#text/plain
 tests/webtbs/tw3953b.pp svneol=native#text/plain
+tests/webtbs/tw3967.pp svneol=native#text/plain
 tests/webtbs/tw3971.pp svneol=native#text/plain
 tests/webtbs/tw3973.pp svneol=native#text/plain
 tests/webtbs/tw3977.pp svneol=native#text/plain

+ 23 - 0
tests/webtbs/tw3967.pp

@@ -0,0 +1,23 @@
+{ Source provided for Free Pascal Bug Report 3967 }
+{ Submitted by "luoyonggang" on  2005-05-14 }
+{ e-mail: [email protected] }
+var
+  i,j,n,m,k,l:longint;
+  o,p,q,s:int64;
+begin
+  s:=1; p:=1;
+  for i:=3 downto 1 do begin
+    if s*(i+2) mod i=0 then s:=s*(i+2) div i else begin
+      s:=s*(i+2);
+      p:=p*i;
+      {The error is here!If we swap the variable i and the variable p then the value of the variable p is right}
+      {But now the value of the vairable p is zero,you see,the value of the vairable p must be 3}
+      {The compiler was 1.98}
+      if p<>3 then
+        halt(1);
+    end
+  end;
+  if p<>3 then
+    halt(1);
+  writeln('ok');
+end.