Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-anon-70.cs
index 414ae0e99c055eb057c50c3990ff297ab9950aa6..d0fe4b7a07a7e3867f65815af18f0fe09b435a9a 100644 (file)
@@ -1,7 +1,17 @@
+// Compiler options: -unsafe
+
 // Cloning tests
 
 using System;
 
+unsafe class UnsafeClass
+{
+       public int* GetUnsafeValue ()
+       {
+               return null;
+       }
+}
+
 public class C
 {
        delegate void D ();
@@ -10,6 +20,18 @@ public class C
        {
        }
        
+       unsafe static void UnsafeTests ()
+       {
+               UnsafeClass v = new UnsafeClass ();
+               Test (delegate () {
+                       int i = *v.GetUnsafeValue ();
+               });
+
+               Test (delegate () {
+                       byte* buffer = stackalloc byte[8192];
+               });
+       }
+       
        public static void Main ()
        {
                Exception diffException;
@@ -40,3 +62,4 @@ public class C
 
        }
 }
+