[Wasm] Fix memory override in mono_wasm_add_assembly
[mono-project.git] / mcs / tests / test-38.cs
blob24997e8dd06238e703bd86f500e929e7edea5c93
1 class X {
2 public int v1, v2;
3 int y;
5 public int this [int a] {
6 get {
7 if (a == 0)
8 return v1;
9 else
10 return v2;
13 set {
14 if (a == 0)
15 v1 = value;
16 else
17 v2 = value;
21 public int Foo () {
22 return 8;
25 public int Bar {
26 get {
27 return y;
30 set {
31 y = value;
36 class Y {
37 public uint v1, v2;
38 uint y;
40 public uint this [uint a] {
41 get {
42 if (a == 0)
43 return v1;
44 else
45 return v2;
48 set {
49 if (a == 0)
50 v1 = value;
51 else
52 v2 = value;
56 public uint Foo () {
57 return 8;
60 public uint Bar {
61 get {
62 return y;
65 set {
66 y = value;
71 class Test {
73 public static int Main ()
75 X x = new X ();
76 Y y = new Y ();
77 int b;
79 x [0] = x [1] = 1;
80 x [0] = 1;
81 if (x.v1 != 1)
82 return 1;
84 if (x [0] != 1)
85 return 2;
87 double d;
88 long l;
90 d = l = b = x [0] = x [1] = x.Bar = x [2] = x [3] = x [4] = x.Foo ();
92 if (x.Bar != 8)
93 return 3;
95 if (l != 8)
96 return 4;
98 uint e, f;
99 e = 5;
100 e = f = 8;
102 if (e != 8)
103 return 5;
105 y [0] = y [1] = 9;
106 y [0] = y.Bar = 12;
108 if (y.Bar != 12)
109 return 6;
111 y.Bar = 15;
112 if (y.Bar != 15)
113 return 7;
115 return 0;