[asp.net] Optimize memory usage a bit. String hashes are cached in thread-local storage.
[mono.git] / mcs / tests / gtest-anon-23.cs
1 // Cloning tests
2
3 using System;
4 using System.Collections.Generic;
5
6 class MemberAccessData
7 {
8         public volatile uint VolatileValue;
9         public string [] StringValues;
10         public List<string> ListValues;
11         
12         int? mt;
13         public int? MyTypeProperty {
14                 set     {
15                         mt = value;
16                 }
17                 get {
18                         return mt;
19                 }
20         }
21 }
22
23 public class B
24 {
25         protected virtual void BaseM ()
26         {
27         }
28 }
29
30 public class C : B
31 {
32         delegate void D ();
33         
34         static void Test (D d)
35         {
36         }
37         
38         void InstanceTests ()
39         {
40                 Test (() => base.BaseM ());
41         }
42         
43         public static void Main ()
44         {
45                 Exception diffException;
46                 
47                 Test (() => {
48                         diffException = null;
49                                         try {
50                                         } catch (Exception ex) {
51                                                 diffException = ex;
52                                         } finally {
53                                         }
54                                         
55                                         try {
56                                         } catch {
57                                         }
58                                 });
59                                 
60                 int[] i_a = new int [] { 1,2,3 };
61                 
62                 Test (() => {
63                                 foreach (int t in i_a) {
64                                 }
65                         });
66                         
67                 Test (() => {
68                         Console.WriteLine (typeof (void));
69                 });
70                 
71                 Test (() => {
72                         Console.WriteLine (typeof (Func<,>));
73                 });
74                 
75                 Test (() => {
76                         object o = new List<object> { "Hello", "", null, "World", 5 };
77                 });
78                 
79                 Test (() => {
80                         var v = new MemberAccessData { 
81                                 VolatileValue = 2, StringValues = new string [] { "sv" }, MyTypeProperty = null
82                         };
83                 });
84                 
85                 var c = new C ();
86                 c.InstanceTests ();
87         }
88 }