[counters] Fix file handle leak in cpu_load ()
[mono-project.git] / mcs / tests / test-906.cs
blob9a34e43877330b5289d2540deab93d90c18405ac
1 // Compiler options: -langversion:experimental
2 using System;
4 struct S1
6 public readonly int Value;
8 public S1 ()
10 Value = 17;
14 struct S2
16 public readonly int Value = 23;
19 struct S3
21 public readonly int Value = 11;
23 public S3 ()
25 Value = 5;
29 struct S4
31 public readonly int Value = 11;
33 public S4 (int v)
38 struct S5
40 public readonly int Value = 7;
42 public S5 (int v)
43 : this ()
45 this.Value += v;
49 class C
51 static int Main ()
53 var s = new S1 ();
54 if (s.Value != 17)
55 return 1;
57 var s2 = new S2 ();
58 if (s2.Value != 23)
59 return 2;
61 var s3 = new S3 ();
62 if (s3.Value != 5)
63 return 3;
65 var s4 = new S4 (5);
66 if (s4.Value != 11)
67 return 4;
69 var s5 = new S5 (2);
70 if (s5.Value != 9)
71 return 5;
73 Console.WriteLine ("ok");
74 return 0;