2010-05-27 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / tests / test-anon-70.cs
index 061757aaba6b45bd150ef5a0e0c4c48a3dcfd873..2376311430a67850f0652e333238936258707279 100644 (file)
@@ -1,3 +1,17 @@
+// Compiler options: -unsafe
+
+// Cloning tests
+
+using System;
+
+unsafe class UnsafeClass
+{
+       public int* GetUnsafeValue ()
+       {
+               return null;
+       }
+}
+
 public class C
 {
        delegate void D ();
@@ -6,13 +20,43 @@ public class C
        {
        }
        
+       unsafe static void UnsafeTests ()
+       {
+               UnsafeClass v = new UnsafeClass ();
+               Test (delegate () {
+                       int i = *v.GetUnsafeValue ();
+               });
+       }
+       
+       
        public static void Main ()
        {
+               Exception diffException;
+               
+               Test (delegate () {
+                       diffException = null;
+                                       try {
+                                       } catch (Exception ex) {
+                                               diffException = ex;
+                                       } finally {
+                                       }
+                                       
+                                       try {
+                                       } catch {
+                                       }
+                               });
+                               
                int[] i_a = new int [] { 1,2,3 };
                
                Test (delegate () {
                                foreach (int t in i_a) {
                                }
                        });
+                       
+               Test (delegate () {
+                       Console.WriteLine (typeof (void));
+               });
+
        }
-}
\ No newline at end of file
+}
+