summaryrefslogtreecommitdiff
path: root/tests/src/reflection/regression/dev10bugs/dev10_630880.cs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/reflection/regression/dev10bugs/dev10_630880.cs')
-rw-r--r--tests/src/reflection/regression/dev10bugs/dev10_630880.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/src/reflection/regression/dev10bugs/dev10_630880.cs b/tests/src/reflection/regression/dev10bugs/dev10_630880.cs
new file mode 100644
index 0000000000..09768299ad
--- /dev/null
+++ b/tests/src/reflection/regression/dev10bugs/dev10_630880.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Runtime.CompilerServices;
+using System.Security;
+
+/* Regression case for Dev10 #630880 - SL4: User Breaking Change: Users are not able to run critical class constructors in platform assembles */
+
+public class Dev10_630880
+{
+ public static int Main()
+ {
+ int failures = 0;
+
+ Console.WriteLine("Getting type of System.AppDomainManager.");
+ Type t = Type.GetType("System.AppDomainManager");
+
+ Console.WriteLine("Getting type handle of System.AppDomainManager type.");
+ RuntimeTypeHandle h = t.TypeHandle;
+
+ Console.WriteLine("Calling RuntimeHelpers.RunClassConstructor with type handle of System.AppDomainManager type.");
+ try
+ {
+ // In V2, this throws TypeLoadException.
+ // In V4, this shouldn't throw any exception
+ RuntimeHelpers.RunClassConstructor(h);
+
+ Console.WriteLine("PASS> No exception is thrown.");
+ }
+ catch (Exception e)
+ {
+ failures++;
+ Console.WriteLine("FAIL> Unexpected {0}!", e.GetType());
+ Console.WriteLine("Please revisit Dev10 #630880.");
+ Console.WriteLine();
+ Console.WriteLine(e);
+ }
+
+ Console.WriteLine();
+ Console.WriteLine("TEST {0}", failures == 0 ? "PASSED." : "FAILED!");
+ return 100 + failures;
+ }
+}