diff options
Diffstat (limited to 'tests/src/Loader/classloader/regressions/111021/main.cs')
-rw-r--r-- | tests/src/Loader/classloader/regressions/111021/main.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/src/Loader/classloader/regressions/111021/main.cs b/tests/src/Loader/classloader/regressions/111021/main.cs new file mode 100644 index 0000000000..7a107d7f00 --- /dev/null +++ b/tests/src/Loader/classloader/regressions/111021/main.cs @@ -0,0 +1,30 @@ +// 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; +public class CMain{ + public static int Count = 0; + public static int Main(String[] args){ + String s; + s = Gen<String>.x; + // we expect the Gen<T>.cctor to fire only once! + if(1 == Count){ + Console.WriteLine("PASS"); + return 100; + } + else{ + Console.WriteLine("FAIL"); + return 101; + } + } +} + +public class Gen<T>{ + + public static T x; + static Gen(){ + CMain.Count++; + Console.WriteLine("cctor. Type: {0}",typeof(T).ToString()); + } +} |