linux-packaging-mono/mcs/tests/test-anon-70.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

63 lines
792 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 ();
});
}
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));
});
}
}