More tests.
authorPaolo Molaro <lupus@oddwiz.org>
Wed, 13 Feb 2002 11:25:24 +0000 (11:25 -0000)
committerPaolo Molaro <lupus@oddwiz.org>
Wed, 13 Feb 2002 11:25:24 +0000 (11:25 -0000)
svn path=/trunk/mono/; revision=2369

mono/tests/Makefile.am
mono/tests/newobj-valuetype.cs [new file with mode: 0644]
mono/tests/unreachable-code.cs [new file with mode: 0644]

index 0871a579f8754fca9daf36a37a4c58d0d309ffc1..6bb30d29de6d3ca1098d922be603e9cfe390c9c7 100644 (file)
@@ -34,6 +34,7 @@ TESTSRC=                      \
        enum2.cs                \
        property.cs             \
        enumcast.cs             \
+       newobj-valuetype.cs     \
        arraylist-clone.cs      \
        setenv.cs               \
        vtype.cs                \
diff --git a/mono/tests/newobj-valuetype.cs b/mono/tests/newobj-valuetype.cs
new file mode 100644 (file)
index 0000000..9cc5de2
--- /dev/null
@@ -0,0 +1,21 @@
+
+namespace Test {
+       public struct Struct {
+               public int a;
+
+               public Struct (int val) {
+                       a = val;
+               }
+
+               public static int Main () {
+                       object o = new Struct (1);
+                       Struct s = new Struct (2);
+
+                       if (s.a != 2)
+                               return 1;
+                       if (((Struct)o).a != 1)
+                               return 2;
+                       return 0;
+               }
+       }
+}
diff --git a/mono/tests/unreachable-code.cs b/mono/tests/unreachable-code.cs
new file mode 100644 (file)
index 0000000..c1a9923
--- /dev/null
@@ -0,0 +1,17 @@
+using System;
+
+// You need to compile this test with mcs:
+// csc will discard unreachable code sections
+
+namespace Test {
+       public class Test {
+               public static int Main () {
+                       int var = 0;
+                       goto label2;
+                       label1:
+                       goto label2;
+                       label2:
+                       return var;
+               }
+       }
+}