summary refs log tree commit diff stats
path: root/tests/accept/compile
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-03-23 01:09:52 +0100
committerAraq <rumpf_a@web.de>2011-03-23 01:09:52 +0100
commit5b789f2da8e57ea2adf0c088f5e41fd7a71fe89b (patch)
tree81f2f23d48d56ef7b106d24982231d99809a6def /tests/accept/compile
parent8d734244b14e09c97267432468ac20fcf8ff82eb (diff)
downloadNim-5b789f2da8e57ea2adf0c088f5e41fd7a71fe89b.tar.gz
bugfixes; field discriminant checks; linearScanEnd, unroll, shallow pragmas
Diffstat (limited to 'tests/accept/compile')
-rwxr-xr-x[-rw-r--r--]tests/accept/compile/tfib.nim0
-rwxr-xr-xtests/accept/compile/tlinearscanend.nim24
-rwxr-xr-x[-rw-r--r--]tests/accept/compile/tmacro1.nim0
-rwxr-xr-x[-rw-r--r--]tests/accept/compile/tsortdev.nim0
-rw-r--r--tests/accept/compile/ttypeconverter1.nim6
5 files changed, 30 insertions, 0 deletions
diff --git a/tests/accept/compile/tfib.nim b/tests/accept/compile/tfib.nim
index 09a4d5038..09a4d5038 100644..100755
--- a/tests/accept/compile/tfib.nim
+++ b/tests/accept/compile/tfib.nim
diff --git a/tests/accept/compile/tlinearscanend.nim b/tests/accept/compile/tlinearscanend.nim
new file mode 100755
index 000000000..15fd0c70a
--- /dev/null
+++ b/tests/accept/compile/tlinearscanend.nim
@@ -0,0 +1,24 @@
+
+import strutils
+
+var x = 343
+
+case stdin.readline.parseInt
+of 0: 
+  echo "most common case"
+of 1: 
+  {.linearScanEnd.}
+  echo "second most common case"
+of 2: echo "unlikely: use branch table"
+else: 
+  echo "unlikely too: use branch table"
+
+
+case x
+of 23: echo "23"
+of 343: echo "343"
+of 21: echo "21"
+else: 
+  {.linearScanEnd.}
+  echo "default"
+
diff --git a/tests/accept/compile/tmacro1.nim b/tests/accept/compile/tmacro1.nim
index e96997c47..e96997c47 100644..100755
--- a/tests/accept/compile/tmacro1.nim
+++ b/tests/accept/compile/tmacro1.nim
diff --git a/tests/accept/compile/tsortdev.nim b/tests/accept/compile/tsortdev.nim
index 1246d7581..1246d7581 100644..100755
--- a/tests/accept/compile/tsortdev.nim
+++ b/tests/accept/compile/tsortdev.nim
diff --git a/tests/accept/compile/ttypeconverter1.nim b/tests/accept/compile/ttypeconverter1.nim
new file mode 100644
index 000000000..9553f6568
--- /dev/null
+++ b/tests/accept/compile/ttypeconverter1.nim
@@ -0,0 +1,6 @@
+
+converter p(i: int): bool = return i != 0
+
+if 0:
+  echo "foo"
+