Merge pull request #5636 from BrzVlad/fix-xmm-scan
[mono.git] / mcs / tests / gtest-243.cs
1 // Bugs #77466 and #77460.
2 using System;
3 using System.Reflection;
4 using System.Collections.Generic;
5
6 public class Foo<T>
7 {
8         public void Test (T t)
9         { }
10 }
11
12 public class Tests
13 {
14         public static void foo<T> ()
15         {
16         }
17
18         public static int Test ()
19         {
20                 MethodInfo mi = typeof (Tests).GetMethod ("foo");
21                 if (!mi.IsGenericMethod)
22                         return 1;
23                 if (!mi.IsGenericMethodDefinition)
24                         return 2;
25                 MethodInfo mi2 = mi.MakeGenericMethod (new Type[] { typeof (int) });
26                 if (!mi2.IsGenericMethod)
27                         return 3;
28                 if (mi2.IsGenericMethodDefinition)
29                         return 4;
30
31                 MethodInfo mi3 = typeof (Foo<int>).GetMethod ("Test");
32                 if (mi3.IsGenericMethod)
33                         return 5;
34                 if (mi3.IsGenericMethodDefinition)
35                         return 6;
36
37                 return 0;
38         }
39
40         public static int Main ()
41         {
42                 int result = Test ();
43 #if DEBUG
44                 if (result == 0)
45                         Console.WriteLine ("OK");
46                 else
47                         Console.WriteLine ("ERROR: {0}", result);
48 #endif
49                 return result;
50         }
51 }