Browse Source

+ some new tests for the goto checking in exception blocks added

florian 26 years ago
parent
commit
4598827d00
6 changed files with 71 additions and 0 deletions
  1. 3 0
      tests/README
  2. 24 0
      tests/testgoto.pp
  3. 10 0
      tests/tf/tf000003.pp
  4. 10 0
      tests/tf/tf000004.pp
  5. 10 0
      tests/tf/tf000005.pp
  6. 14 0
      tests/tf/tf000006.pp

+ 3 - 0
tests/README

@@ -53,3 +53,6 @@ testaoc.pp        test Array of construct.
 testansi.pp       test ansistrings
 testansi.pp       test ansistrings
 testrtti.pp       test RTTI generation and typinfo unit.
 testrtti.pp       test RTTI generation and typinfo unit.
 testexc.pp        test exceptions.
 testexc.pp        test exceptions.
+testi642.pp       test int64/qword
+testpvar.pp       test procedure variables
+testgoto.pp       test goto (very simple)

+ 24 - 0
tests/testgoto.pp

@@ -0,0 +1,24 @@
+
+function test : longint;
+
+label l;
+
+
+var
+   a,b : longint;
+
+begin
+   a:=1;
+   b:=1;
+   l:
+     if a>b then
+       begin
+          exit(0);
+       end;
+   a:=2;
+   goto l;
+end;
+
+begin
+   test;
+end.

+ 10 - 0
tests/tf/tf000003.pp

@@ -0,0 +1,10 @@
+{$mode objfpc}
+label l;
+
+begin
+   try
+      goto l;
+   finally     
+   end;
+   l:
+end.

+ 10 - 0
tests/tf/tf000004.pp

@@ -0,0 +1,10 @@
+{$mode objfpc}
+label l;
+
+begin
+   try
+   finally     
+   l:
+   end;
+   goto l;
+end.

+ 10 - 0
tests/tf/tf000005.pp

@@ -0,0 +1,10 @@
+{$mode objfpc}
+label l;
+
+begin
+   try
+   except
+      goto l;
+   end;
+   l:
+end.

+ 14 - 0
tests/tf/tf000006.pp

@@ -0,0 +1,14 @@
+{$mode objfpc}
+uses
+   sysutils;
+
+label l;
+
+begin
+   try
+   except
+      on e : exception do
+        goto l;
+   end;
+   l:
+end.