[coop] Refactor/reuse mono_value_box_handle/mono_value_box_checked and reduce raw...
[mono-project.git] / mono / benchmark / switch.cs
blobda3cb9d1f477fd6aae2b94b0d09577e70c8d5f28
1 public class Tests {
3 public static int Main () {
4 int n = 2;
5 int b = 0;
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;
19 if (b != 4)
20 return 1;
22 return 0;