Author: marek
Date: 2007-01-17 17:19:37 -0500 (Wed, 17 Jan 2007)
New Revision: 71234
Added:
trunk/mcs/tests/gtest-305.cs
trunk/mcs/tests/test-554.cs
Log:
New tests based on #80522
Added: trunk/mcs/tests/gtest-305.cs
===================================================================
--- trunk/mcs/tests/gtest-305.cs 2007-01-17 22:18:22 UTC (rev 71233)
+++ trunk/mcs/tests/gtest-305.cs 2007-01-17 22:19:37 UTC (rev 71234)
@@ -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
Property changes on: trunk/mcs/tests/gtest-305.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/tests/test-554.cs
===================================================================
--- trunk/mcs/tests/test-554.cs 2007-01-17 22:18:22 UTC (rev 71233)
+++ trunk/mcs/tests/test-554.cs 2007-01-17 22:19:37 UTC (rev 71234)
@@ -0,0 +1,42 @@
+using System;
+
+class C
+{
+ public static int Main ()
+ {
+ long [,,] a1 = new long [2,3,2] {{{0,1}, {2,3}, {4,5}}, {{6,7},
{8,9}, {10,11}}};
+
+ long[] l = new long[] {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5,
6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5,
6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5,
6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5,
6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5,
6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5,
6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5,
6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5,
6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5,
6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5,
6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5,
6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5,
6, 7, 8, 9,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5,
6, 7, 8, 9,
+ };
+
+ if (l [1] != 1) {
+ Console.WriteLine ("incorrect at 1: {0}", l
[1]);
+ return 1;
+ }
+
+
+ int v = 6;
+ int[] a2 = new int[] { 0, 1, 2, 3, 4, 5, v };
+
+ for (int i = 0; i < a2.Length; ++i) {
+ if (a2 [i] != i)
+ return 2;
+ }
+
+ Console.WriteLine ("OK");
+ return 0;
+ }
+}
\ No newline at end of file
Property changes on: trunk/mcs/tests/test-554.cs
___________________________________________________________________
Name: svn:eol-style
+ native
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches