summary refs log tree commit diff stats
path: root/tests/accept/compile/tlinearscanend.nim
blob: 15fd0c70a17d0d548e586439bc4770cca30813c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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"