[tuner] handle the case with multiple "preserve" attributes
[mono-project.git] / mcs / tests / dtest-035.cs
blob6f83bc2d2bf417aae733b2fc103fb5156a7758a6
1 using System;
3 public class Test
5 public dynamic this[int i] {
6 get {
7 return 0;
9 set {
13 public dynamic[] Prop {
14 get {
15 return new dynamic [] { 0 };
17 set {
21 public int Prop2 {
22 get {
23 return 5;
25 set {
29 int prop = 500;
30 public dynamic Prop3
32 get { return prop; }
33 set { prop = value; }
36 public static int Main ()
38 int i = 0;
39 var d = new dynamic[] { 1 };
40 d[i++] += null;
41 if (i != 1)
42 return 1;
44 i = 0;
45 var t = new Test ();
46 t [i++] += null;
47 if (i != 1)
48 return 2;
50 i = 0;
51 t.Prop [i++] += null;
52 if (i != 1)
53 return 3;
55 i = 0;
56 d [0] = 9;
57 t.Prop2 += d [0];
59 int v = 3;
60 v *= t.Prop3 -= 15;
61 if (v != 1455)
62 return 4;
64 dynamic dvalue = 3;
65 int[] iar = new [] { -14 };
66 iar [0] += dvalue;
67 if (iar [0] != -11)
68 return 5;
70 dynamic dn = 1;
71 int?[] array = new int?[1];
72 array[0] = dn;
73 if (array [0] != 1)
74 return 6;
76 Console.WriteLine ("ok");
77 return 0;