From 0a75e81d90459cccaa92da18c874e93c4b7ec05e Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Tue, 25 Nov 2008 15:01:35 +0000 Subject: [PATCH] New tests. svn path=/trunk/mcs/; revision=119955 --- mcs/tests/gtest-161.cs | 25 ++++++----- mcs/tests/gtest-426.cs | 30 +++++++++++++ mcs/tests/gtest-427.cs | 32 ++++++++++++++ mcs/tests/ver-il-gmcs.xml | 92 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 169 insertions(+), 10 deletions(-) create mode 100644 mcs/tests/gtest-426.cs create mode 100644 mcs/tests/gtest-427.cs diff --git a/mcs/tests/gtest-161.cs b/mcs/tests/gtest-161.cs index c538f6bd93d..6f119fa124f 100644 --- a/mcs/tests/gtest-161.cs +++ b/mcs/tests/gtest-161.cs @@ -1,13 +1,18 @@ // Compiler options: -r:gtest-161-lib.dll -public class App { - public static void Main() { - string s = apply(3, - delegate (int x) { - return x.ToString(); }); - int y = apply(3, FP.identity); - } - static U apply(T obj, FP.Mapping f) { - return f(obj); - } +public class App +{ + public static void Main () + { + string s = apply (3, delegate (int x) { + return x.ToString (); + }); + + int y = apply (3, FP.identity); + } + + static U apply (T obj, FP.Mapping f) + { + return f (obj); + } } diff --git a/mcs/tests/gtest-426.cs b/mcs/tests/gtest-426.cs new file mode 100644 index 00000000000..133bd334453 --- /dev/null +++ b/mcs/tests/gtest-426.cs @@ -0,0 +1,30 @@ +using System; + +namespace OverloadTest +{ + public interface MyInterface + { + void Invoke (T target); + } + + public class MyClass + { + + public bool Method (MyInterface obj) + { + return Method (obj.Invoke); + } + + public bool Method (Action 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 index 00000000000..e3830d79c47 --- /dev/null +++ b/mcs/tests/gtest-427.cs @@ -0,0 +1,32 @@ + +delegate void EventHandler (object sender); +delegate void EventHandler (T sender); + +class T +{ + void Test () + { + Attach (OnClick); + } + + void Attach (EventHandler handler) + { + throw null; + } + + void Attach (EventHandler handler) + { + } + + void OnClick (string sender) + { + } + + public static void Main () + { + new T ().Test (); + } +} + + + diff --git a/mcs/tests/ver-il-gmcs.xml b/mcs/tests/ver-il-gmcs.xml index f92bdfb45a9..959b6f12316 100644 --- a/mcs/tests/ver-il-gmcs.xml +++ b/mcs/tests/ver-il-gmcs.xml @@ -11131,6 +11131,77 @@ + + + + 7 + + + 20 + + + 2 + + + + + 7 + + + 1 + + + + + + + 7 + + + 19 + + + 2 + + + 1 + + + 1 + + + 11 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + @@ -33173,6 +33244,27 @@ + + + + 7 + + + 53 + + + 680 + + + 28 + + + + + 7 + + + -- 2.25.1