diff options
Diffstat (limited to 'tests/src/readytorun/tests/genericsload/callgenericctor.cs')
-rw-r--r-- | tests/src/readytorun/tests/genericsload/callgenericctor.cs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/src/readytorun/tests/genericsload/callgenericctor.cs b/tests/src/readytorun/tests/genericsload/callgenericctor.cs new file mode 100644 index 0000000000..05e16afb3b --- /dev/null +++ b/tests/src/readytorun/tests/genericsload/callgenericctor.cs @@ -0,0 +1,35 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// + +using System; +using System.Runtime.CompilerServices; + +class Foo<T> +{ + [MethodImplAttribute(MethodImplOptions.NoInlining)] + internal void M() + { + new GenClass<T>(); + } +} + +class Program +{ + static int Main() + { + try + { + new Foo<string>().M(); + } + catch (Exception e) + { + Console.WriteLine("FAIL"); + return 101; + } + + Console.WriteLine("PASS"); + return 100; + } +} |