diff options
Diffstat (limited to 'tests/accept/compile')
-rwxr-xr-x[-rw-r--r--] | tests/accept/compile/tfib.nim | 0 | ||||
-rwxr-xr-x | tests/accept/compile/tlinearscanend.nim | 24 | ||||
-rwxr-xr-x[-rw-r--r--] | tests/accept/compile/tmacro1.nim | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | tests/accept/compile/tsortdev.nim | 0 | ||||
-rw-r--r-- | tests/accept/compile/ttypeconverter1.nim | 6 |
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" + |