new tester; all tests categorized
This commit is contained in:
parent
51ee524109
commit
20b5f31c03
481 changed files with 794 additions and 2506 deletions
24
tests/casestmt/tlinearscanend.nim
Normal file
24
tests/casestmt/tlinearscanend.nim
Normal file
|
|
@ -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"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue