repo.or.cz
/
mono-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[coop] Refactor/reuse mono_value_box_handle/mono_value_box_checked and reduce raw...
[mono-project.git]
/
mono
/
benchmark
/
switch.cs
blob
da3cb9d1f477fd6aae2b94b0d09577e70c8d5f28
1
public class
Tests
{
2
3
public static int
Main
() {
4
int
n
=
2
;
5
int
b
=
0
;
6
7
for
(
int
i
=
0
;
i
<
1000000000
;
i
++) {
8
switch
(
n
) {
9
case
0
:
b
=
2
;
break
;
10
case
1
:
b
=
3
;
break
;
11
case
2
:
b
=
4
;
break
;
12
case
-
1
:
b
=
5
;
break
;
13
default
:
14
b
=
6
;
15
break
;
16
}
17
}
18
19
if
(
b
!=
4
)
20
return
1
;
21
22
return
0
;
23
}
24
}
25
26