tgotoreg.pp 430 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. {% OPT=-Or}
  2. {$goto on}
  3. var
  4. global: longint;
  5. procedure t1;
  6. begin
  7. { make sure it's not put in a register in t }
  8. global := 1;
  9. end;
  10. procedure t;
  11. var
  12. l: longint;
  13. s1,s2,s3: ansistring;
  14. label lab;
  15. begin
  16. t1;
  17. l := 1;
  18. s1 := 'ABC';
  19. s2 := 'DEF';
  20. s3 := '';
  21. lab:
  22. inc(l);
  23. inc(global);
  24. if global > 10 then
  25. halt(1);
  26. if l = 10 then
  27. s3 := 'ABCDEF';
  28. if s1+s2 <> s3 then
  29. goto lab;
  30. end;
  31. begin
  32. t;
  33. end.