X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Ftests%2Fgeneric-stack-traces2.2.cs;h=a051365508c299c60ab6f94422f732ffe2e6e111;hb=2b2fbe074acbeb118f23ee68a4419638e3a98723;hp=df457096cb8f9569df124cc500fbdd1294594b62;hpb=82a1631ac4ccb2c0d8ae97acb5aa2821430bb9f5;p=mono.git diff --git a/mono/tests/generic-stack-traces2.2.cs b/mono/tests/generic-stack-traces2.2.cs index df457096cb8..a051365508c 100644 --- a/mono/tests/generic-stack-traces2.2.cs +++ b/mono/tests/generic-stack-traces2.2.cs @@ -1,19 +1,42 @@ using System; using System.Threading; +using System.Runtime.CompilerServices; +using System.Diagnostics; namespace GetStackTrace { class Gen {} + class C + { + [MethodImplAttribute (MethodImplOptions.NoInlining)] + public int foo () { + return new StackTrace ().GetFrame (0).GetMethod ().DeclaringType.IsGenericTypeDefinition ? 1 : 0; + } + } + + class D : C + { + } + class Program { - static void Main (string[] args) + static int Main (string[] args) { Thread t = new Thread (new ParameterizedThreadStart (Test)); t.Start (null); t.Join (); + + if (test_0_nongeneric_subclass () != 0) + return 1; + return 0; } + /* Test for gshared methods declared in a generic subclass of a nongeneric class */ + public static int test_0_nongeneric_subclass () { + return new D ().foo (); + } + static void Test (object test) { Console.WriteLine (typeof (Gen).ToString ());