From 5b789f2da8e57ea2adf0c088f5e41fd7a71fe89b Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 23 Mar 2011 01:09:52 +0100 Subject: bugfixes; field discriminant checks; linearScanEnd, unroll, shallow pragmas --- tests/accept/compile/tlinearscanend.nim | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 tests/accept/compile/tlinearscanend.nim (limited to 'tests/accept/compile/tlinearscanend.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" + -- cgit 1.4.1-2-gfad0