Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2007-01-18 01:19:37 +0300
committerMarek Safar <marek.safar@gmail.com>2007-01-18 01:19:37 +0300
commit13dce1baabd1c8bc03934b325248443947a9bfbf (patch)
tree5bb1175a3496f6884e66b4b8a2aaed989ec21a48 /mcs/tests/gtest-305.cs
parent957317c0fd4d8dc99556a004e44b5eef099d8845 (diff)
New tests based on #80522
svn path=/trunk/mcs/; revision=71234
Diffstat (limited to 'mcs/tests/gtest-305.cs')
-rw-r--r--mcs/tests/gtest-305.cs29
1 files changed, 29 insertions, 0 deletions
diff --git a/mcs/tests/gtest-305.cs b/mcs/tests/gtest-305.cs
new file mode 100644
index 00000000000..fde47d2beb9
--- /dev/null
+++ b/mcs/tests/gtest-305.cs
@@ -0,0 +1,29 @@
+// No array static/dynamic initilizers should be produced in this test
+
+using System;
+using System.Reflection;
+
+class T
+{
+ const byte c = 0;
+ const string s = null;
+
+ long [,,] a1 = new long [,,] {{{10,0}, {0,0}}, {{0,0}, {0,c}}};
+ byte [] a2 = new byte [] { 2 - 2, 0, c };
+ decimal [] a3 = new decimal [] { 2m - 2m, 0m, c };
+ string[,] a4 = new string[,] { {s, null}, { s, s }};
+ T[] a5 = new T[] { null, default (T) };
+
+ public static int Main ()
+ {
+ ConstructorInfo mi = typeof(T).GetConstructors ()[0];
+ MethodBody mb = mi.GetMethodBody();
+
+ if (mb.GetILAsByteArray ().Length > 90) {
+ Console.WriteLine("Optimization failed");
+ return 3;
+ }
+
+ return 0;
+ }
+} \ No newline at end of file