summary refs log tree commit diff stats
path: root/tests/accept/compile/tfib.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-03-14 23:57:41 +0100
committerAraq <rumpf_a@web.de>2011-03-14 23:57:41 +0100
commit8d734244b14e09c97267432468ac20fcf8ff82eb (patch)
tree253eae61df789c42efe49b7c30cf38c66a3c208e /tests/accept/compile/tfib.nim
parent6850fb73c1b9ae8d3f56a61ee37922c3cb3788d6 (diff)
downloadNim-8d734244b14e09c97267432468ac20fcf8ff82eb.tar.gz
linearScanEnd pragma; string case statement optimization
Diffstat (limited to 'tests/accept/compile/tfib.nim')
-rw-r--r--tests/accept/compile/tfib.nim11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/accept/compile/tfib.nim b/tests/accept/compile/tfib.nim
new file mode 100644
index 000000000..09a4d5038
--- /dev/null
+++ b/tests/accept/compile/tfib.nim
@@ -0,0 +1,11 @@
+
+iterator fibonacci(): int = 
+  var a = 0
+  var b = 1
+  while true: 
+    yield a
+    var c = b
+    b = a
+    a = a + c
+
+