summaryrefslogtreecommitdiff
path: root/tests/webtbs/tw35820.pp
blob: 0d5cd3f04da324e9ac680d48e4c656fa6681e625 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
program BugExample;

{$mode ObjFPC}
{$GOTO ON}

type SubRange = 1..3;

  procedure Blah(const I: SubRange); inline;
  var
    B: Boolean = True;
  label
    Top;
  begin
    Top:
      case I of
        1:
          WriteLn(2);
        2:
          if B then
          begin
            B := False;
            WriteLn('Resetting!');
            goto Top;
          end
          else
            WriteLn(4);
        3:
          WriteLn(6);
      end;
  end;

  procedure DoIt;
  begin
    Blah(1);
    Blah(2);
    Blah(3);
  end;

begin
  DoIt;
end.