A tests for bug #335847
svn path=/trunk/mcs/; revision=88285
--- /dev/null
+// Compiler options: -langversion:linq
+
+struct Point
+{
+ public int X, Y;
+}
+
+class C
+{
+ static Point p;
+
+ public static int Main ()
+ {
+ new Point {
+ X = 0,
+ Y = 0
+ };
+
+ var markerPosition = new Point {
+ X = 2 * 3,
+ Y = 9
+ };
+
+ if (markerPosition.X != 6)
+ return 1;
+
+ if (markerPosition.Y != 9)
+ return 2;
+
+ Point[] pa = new Point[] { new Point { X = 9 }, new Point { X = 8 } };
+
+ if (pa [0].X != 9)
+ return 3;
+
+ if (pa [1].X != 8)
+ return 3;
+
+ p = new Point { Y = -1 };
+ if (p.Y != -1)
+ return 4;
+
+ return 0;
+ }
+}
--- /dev/null
+// Compiler options: -langversion:linq
+
+struct Point
+{
+ public int X, Y;
+}
+
+class C
+{
+ public static int Main ()
+ {
+ Point p;
+ Foo (out p);
+
+ if (p.X != 3)
+ return 1;
+
+ if (p.Y != 5)
+ return 2;
+
+ return 0;
+ }
+
+ static void Foo (out Point p)
+ {
+ p = new Point () { X = 3, Y = 5 };
+ }
+}
--- /dev/null
+public struct C
+{
+ struct S
+ {
+ public int i;
+ public S (int i)
+ {
+ this.i = i;
+ }
+ }
+
+ static S[] s;
+
+ int Test ()
+ {
+ int i = 0;
+ s = new S [1];
+ if (s.Length > 0)
+ s [i++] = new S (10);
+
+ if (s [0].i != 10)
+ return 1;
+
+ return 0;
+ }
+
+ public static int Main ()
+ {
+ return new C().Test ();
+ }
+}
\ No newline at end of file