summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Regression/JitBlue/GitHub_12949/GitHub_12949_5.cs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/JIT/Regression/JitBlue/GitHub_12949/GitHub_12949_5.cs')
-rw-r--r--tests/src/JIT/Regression/JitBlue/GitHub_12949/GitHub_12949_5.cs46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/src/JIT/Regression/JitBlue/GitHub_12949/GitHub_12949_5.cs b/tests/src/JIT/Regression/JitBlue/GitHub_12949/GitHub_12949_5.cs
new file mode 100644
index 0000000000..95a89457ed
--- /dev/null
+++ b/tests/src/JIT/Regression/JitBlue/GitHub_12949/GitHub_12949_5.cs
@@ -0,0 +1,46 @@
+// 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;
+
+struct R
+{
+ int a;
+}
+
+public class X<K>
+{
+ public X(K k1)
+ {
+ k = k1;
+ }
+
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ public static bool Test(X<K> a)
+ {
+ return (a.k != null);
+ }
+
+ public K k;
+}
+
+class B
+{
+ public static int Main()
+ {
+ X<R> a = null;
+ bool result = false;
+ try
+ {
+ X<R>.Test(a);
+ }
+ catch (Exception)
+ {
+ result = true;
+ }
+ Console.WriteLine("Passed: {0}", result);
+ return result ? 100 : 0;
+ }
+}