Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-anon-70.cs
1 // Compiler options: -unsafe
2
3 // Cloning tests
4
5 using System;
6
7 unsafe class UnsafeClass
8 {
9         public int* GetUnsafeValue ()
10         {
11                 return null;
12         }
13 }
14
15 public class C
16 {
17         delegate void D ();
18         
19         static void Test (D d)
20         {
21         }
22         
23         unsafe static void UnsafeTests ()
24         {
25                 UnsafeClass v = new UnsafeClass ();
26                 Test (delegate () {
27                         int i = *v.GetUnsafeValue ();
28                 });
29
30                 Test (delegate () {
31                         byte* buffer = stackalloc byte[8192];
32                 });
33         }
34         
35         public static void Main ()
36         {
37                 Exception diffException;
38                 
39                 Test (delegate () {
40                         diffException = null;
41                                         try {
42                                         } catch (Exception ex) {
43                                                 diffException = ex;
44                                         } finally {
45                                         }
46                                         
47                                         try {
48                                         } catch {
49                                         }
50                                 });
51                                 
52                 int[] i_a = new int [] { 1,2,3 };
53                 
54                 Test (delegate () {
55                                 foreach (int t in i_a) {
56                                 }
57                         });
58                         
59                 Test (delegate () {
60                         Console.WriteLine (typeof (void));
61                 });
62
63         }
64 }
65