2003-05-19 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Mon, 19 May 2003 00:10:39 +0000 (00:10 -0000)
committerMartin Baulig <martin@novell.com>
Mon, 19 May 2003 00:10:39 +0000 (00:10 -0000)
* test-162.cs: Added testcases for structs containing other
structs as fields.  Bug #42597.

svn path=/trunk/mcs/; revision=14679

mcs/tests/ChangeLog
mcs/tests/test-162.cs

index a80bdeb4cb5341ebb524657d99b4f573dc5c32ca..9887e35d58dd904cdf39ac530ce25dd83c18d1a6 100755 (executable)
@@ -1,3 +1,8 @@
+2003-05-19  Martin Baulig  <martin@ximian.com>
+
+       * test-162.cs: Added testcases for structs containing other
+       structs as fields.  Bug #42597.
+
 2003-05-18  Martin Baulig  <martin@ximian.com>
 
        * test-154.cs: Added testcase for bug #41657.
index 284a423d0fb8883bd33828f46126de5e2cf92c67..64e1f4189c38d0e3f35314eea8801573c3664e13 100644 (file)
@@ -34,15 +34,36 @@ struct C
        { }
 }
 
+struct D
+{
+       public int foo;
+}
+
+struct E
+{
+       public D d;
+       public bool e;
+}
+
+struct F
+{
+       public E e;
+       public float f;
+}
+
 class X
 {
        static void test_output (A x)
-       {
-       }
+       { }
 
        static void test_output (B y)
-       {
-       }
+       { }
+
+       static void test_output (E e)
+       { }
+
+       static void test_output (F f)
+       { }
 
        static void test1 ()
        {
@@ -83,6 +104,25 @@ class X
                y.a = 1;
        }
 
+       static void test7 ()
+       {
+               E e;
+               e.e = true;
+               e.d.foo = 5;
+
+               test_output (e);
+       }
+
+       static void test8 ()
+       {
+               F f;
+               f.e.e = true;
+               f.e.d.foo = 5;
+               f.f = 3.14F;
+
+               test_output (f);
+       }
+
        public static int Main ()
        {
                // Compilation-only test.