New tests.
authorMarek Safar <marek.safar@gmail.com>
Tue, 25 Nov 2008 15:01:35 +0000 (15:01 -0000)
committerMarek Safar <marek.safar@gmail.com>
Tue, 25 Nov 2008 15:01:35 +0000 (15:01 -0000)
svn path=/trunk/mcs/; revision=119955

mcs/tests/gtest-161.cs
mcs/tests/gtest-426.cs [new file with mode: 0644]
mcs/tests/gtest-427.cs [new file with mode: 0644]
mcs/tests/ver-il-gmcs.xml

index c538f6bd93d9052ab91e426b0020a4fc2fd6b088..6f119fa124f015020a8f6072c8b917b2f870f712 100644 (file)
@@ -1,13 +1,18 @@
 // Compiler options: -r:gtest-161-lib.dll
-public class App {
-  public static void Main() {
-    string s = apply<int, string>(3,
-                                  delegate (int x) {
-                                    return x.ToString(); });
-    int y = apply<int, int>(3, FP.identity<int>);
-  }
 
-  static U apply<T, U>(T obj, FP.Mapping<T, U> f) {
-    return f(obj);
-  }
+public class App
+{
+       public static void Main ()
+       {
+               string s = apply<int, string> (3, delegate (int x) {
+                       return x.ToString ();
+               });
+
+               int y = apply<int, int> (3, FP.identity<int>);
+       }
+
+       static U apply<T, U> (T obj, FP.Mapping<T, U> f)
+       {
+               return f (obj);
+       }
 }
diff --git a/mcs/tests/gtest-426.cs b/mcs/tests/gtest-426.cs
new file mode 100644 (file)
index 0000000..133bd33
--- /dev/null
@@ -0,0 +1,30 @@
+using System;
+
+namespace OverloadTest
+{
+       public interface MyInterface<T>
+       {
+               void Invoke (T target);
+       }
+
+       public class MyClass<T>
+       {
+
+               public bool Method (MyInterface<T> obj)
+               {
+                       return Method (obj.Invoke);
+               }
+
+               public bool Method (Action<T> myAction)
+               {
+                       return true;
+               }
+       }
+
+       class C
+       {
+               public static void Main ()
+               {
+               }
+       }
+}
diff --git a/mcs/tests/gtest-427.cs b/mcs/tests/gtest-427.cs
new file mode 100644 (file)
index 0000000..e3830d7
--- /dev/null
@@ -0,0 +1,32 @@
+
+delegate void EventHandler (object sender);
+delegate void EventHandler<T> (T sender);
+
+class T
+{
+       void Test ()
+       {
+               Attach (OnClick);
+       }
+
+       void Attach (EventHandler handler)
+       {
+               throw null;
+       }
+
+       void Attach (EventHandler<string> handler)
+       {
+       }
+
+       void OnClick (string sender)
+       {
+       }
+
+       public static void Main ()
+       {
+               new T ().Test ();
+       }
+}
+
+
+
index f92bdfb45a95fe3c90ae273ab690880e63a24cbe..959b6f12316abefaa576fd99d72e29ce2f9ccd24 100644 (file)
       </method>
     </type>
   </test>
+  <test name="gtest-426.cs">
+    <type name="OverloadTest.MyClass`1[T]">
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+      <method name="Boolean Method(MyInterface`1)">
+        <size>20</size>
+      </method>
+      <method name="Boolean Method(System.Action`1[T])">
+        <size>2</size>
+      </method>
+    </type>
+    <type name="OverloadTest.C">
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+      <method name="Void Main()">
+        <size>1</size>
+      </method>
+    </type>
+  </test>
+  <test name="gtest-427.cs">
+    <type name="T">
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+      <method name="Void Test()">
+        <size>19</size>
+      </method>
+      <method name="Void Attach(EventHandler)">
+        <size>2</size>
+      </method>
+      <method name="Void Attach(EventHandler`1[System.String])">
+        <size>1</size>
+      </method>
+      <method name="Void OnClick(System.String)">
+        <size>1</size>
+      </method>
+      <method name="Void Main()">
+        <size>11</size>
+      </method>
+    </type>
+    <type name="EventHandler">
+      <method name="Void .ctor(Object, IntPtr)">
+        <size>0</size>
+      </method>
+      <method name="Void Invoke(System.Object)">
+        <size>0</size>
+      </method>
+      <method name="IAsyncResult BeginInvoke(System.Object, System.AsyncCallback, System.Object)">
+        <size>0</size>
+      </method>
+      <method name="Void EndInvoke(IAsyncResult)">
+        <size>0</size>
+      </method>
+    </type>
+    <type name="EventHandler`1[T]">
+      <method name="Void .ctor(Object, IntPtr)">
+        <size>0</size>
+      </method>
+      <method name="Void Invoke(T)">
+        <size>0</size>
+      </method>
+      <method name="IAsyncResult BeginInvoke(T, System.AsyncCallback, System.Object)">
+        <size>0</size>
+      </method>
+      <method name="Void EndInvoke(IAsyncResult)">
+        <size>0</size>
+      </method>
+    </type>
+  </test>
   <test name="gtest-anon-1.cs">
     <type name="X">
       <method name="Void .ctor()">
       </method>
     </type>
   </test>
+  <test name="test-695.cs">
+    <type name="Program">
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+      <method name="Void .cctor()">
+        <size>53</size>
+      </method>
+      <method name="Int32 Main()">
+        <size>680</size>
+      </method>
+      <method name="System.String get_BaseDirectory()">
+        <size>28</size>
+      </method>
+    </type>
+    <type name="&lt;PrivateImplementationDetails&gt;">
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="test-7.cs">
     <type name="Mine.MyBoolean">
       <method name="Void .ctor()">