Fix libmini targets and filters.
[mono.git] / mono / tests / generic-stack-traces2.2.cs
1 using System;
2 using System.Threading;
3 using System.Runtime.CompilerServices;
4 using System.Diagnostics;
5
6 namespace GetStackTrace
7 {
8     class Gen<T> {}
9
10         class C<T>
11         {
12                 [MethodImplAttribute (MethodImplOptions.NoInlining)]
13                 public int foo () {
14                         return new StackTrace ().GetFrame (0).GetMethod ().DeclaringType.IsGenericTypeDefinition ? 1 : 0;
15                 }
16         }
17
18         class D : C<string>
19         {
20         }
21
22     class Program
23     {
24         static int Main (string[] args)
25         {
26             Thread t = new Thread (new ParameterizedThreadStart (Test<string>));
27             t.Start (null);
28             t.Join ();
29
30                         if (test_0_nongeneric_subclass () != 0)
31                                 return 1;
32                         return 0;
33         }
34
35                 /* Test for gshared methods declared in a generic subclass of a nongeneric class */
36                 public static int test_0_nongeneric_subclass () {
37                         return new D ().foo ();
38                 }
39
40         static void Test<TT> (object test)
41         {
42             Console.WriteLine (typeof (Gen<TT>).ToString ());
43             Console.WriteLine (System.Environment.StackTrace);
44         }
45     }
46 }