linux-packaging-mono/mcs/tests/test-anon-70.cs
Xamarin Public Jenkins c042cd0c52 Imported Upstream version 4.2.0.179
Former-commit-id: 4610231f55806d2a05ed69e5ff3faa7336cc1479
2015-11-10 15:03:43 +00:00

66 lines
860 B
C#

// Compiler options: -unsafe
// Cloning tests
using System;
unsafe class UnsafeClass
{
public int* GetUnsafeValue ()
{
return null;
}
}
public class C
{
delegate void D ();
static void Test (D d)
{
}
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;
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));
});
}
}