[corlib] ParseNumber.StringToInt now check for overflows.
[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         
31         
32         public static void Main ()
33         {
34                 Exception diffException;
35                 
36                 Test (delegate () {
37                         diffException = null;
38                                         try {
39                                         } catch (Exception ex) {
40                                                 diffException = ex;
41                                         } finally {
42                                         }
43                                         
44                                         try {
45                                         } catch {
46                                         }
47                                 });
48                                 
49                 int[] i_a = new int [] { 1,2,3 };
50                 
51                 Test (delegate () {
52                                 foreach (int t in i_a) {
53                                 }
54                         });
55                         
56                 Test (delegate () {
57                         Console.WriteLine (typeof (void));
58                 });
59
60         }
61 }
62