summary refs log tree commit diff stats
path: root/tests/accept/run
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2010-09-20 22:33:23 +0200
committerAraq <rumpf_a@web.de>2010-09-20 22:33:23 +0200
commit0a57f662fa6f15916caa564312a162ddb3c04883 (patch)
treec713e9d318d0c944d678a20b294b4a1a3f0bec74 /tests/accept/run
parentf182d8d708aa3195b87a0e732faf73d3d3fa4b24 (diff)
downloadNim-0a57f662fa6f15916caa564312a162ddb3c04883.tar.gz
bugfix: finally sections are executed before return/break
Diffstat (limited to 'tests/accept/run')
-rwxr-xr-xtests/accept/run/spec.csv4
-rwxr-xr-xtests/accept/run/tfinally.nim11
2 files changed, 11 insertions, 4 deletions
diff --git a/tests/accept/run/spec.csv b/tests/accept/run/spec.csv
index ec98fa70e..66eb7eb6a 100755
--- a/tests/accept/run/spec.csv
+++ b/tests/accept/run/spec.csv
@@ -19,7 +19,9 @@ tconstr2.nim;69
 tcopy.nim;TEMP=C:\Programs\xyz\bin
 tcurrncy.nim;25
 texplicitgeneric1.nim;Key: 12 value: 12Key: 13 value: 13 Key: A value: 12 Key: B value: 13
-tfinally.nim;came here
+tfinally.nim;came here 3
+tfinally2.nim;ABCD
+tfinally3.nim;false
 tfloat1.nim;Error: unhandled exception: FPU operation caused an overflow [EFloatOverflow]
 tfloat2.nim;Error: unhandled exception: FPU operation caused a NaN result [EFloatInvalidOp]
 tformat.nim;Hi Andreas! How do you feel, Rumpf?
diff --git a/tests/accept/run/tfinally.nim b/tests/accept/run/tfinally.nim
index df6397125..034653b2b 100755
--- a/tests/accept/run/tfinally.nim
+++ b/tests/accept/run/tfinally.nim
@@ -2,9 +2,14 @@
 
 proc main: int = 
   try:
-    return 1
+    try:
+      return 1
+    finally:
+      stdout.write("came ")
+      return 2
   finally: 
-    echo "came here"
+    stdout.write("here ")
+    return 3
     
-discard main() #OUT came here
+echo main() #OUT came here 1