[msbuild] bump to xplat-master branch HEAD
[mono.git] / mcs / tests / test-45.cs
index e81d937f5fa76015f22bedce969bbd651682ce75..65a8268bffba89ea5ba7648b4b1beb76e78761e7 100644 (file)
@@ -9,28 +9,46 @@ public class Blah {
        static string [] names = {
                "Miguel", "Paolo", "Dietmar", "Dick", "Ravi"
        };
-       
+
        public static int Main ()
        {
                int [] i = new int [4] { 0, 1, 2, 3 };
 
-               int [,] j = new int [4,2] { {0,1}, {2,3}, {4,5}, {6,7} };
+               short [,] j = new short [4,2] { {0,1}, {2,3}, {4,5}, {6,7} };
                
-               int [] a = { 4, 5, 6, 7 };
+               ushort [] a = { 4, 5, 6, 7 };
 
-               int [,,] m = new int [2,3,2] {{{0,1}, {2,3}, {4,5}}, {{6,7}, {8,9}, {10,11}}};
+               long [,,] m = new long [2,3,2] {{{0,1}, {2,3}, {4,5}}, {{6,7}, {8,9}, {10,11}}};
 
                int foo = 1;
                int [] k = new int [] { foo, foo+1, foo+4 };
 
-               int [,] boo = new int [,] {{foo, foo+10}, {foo+3, foo+10}};
+               int [,] boo = new int [,] {{foo, foo+10}, {foo+3, foo+10}};
+
+               float [] f_array = new float [] { 1.23F, 4.5F, 6.24F };
+
+               double [] double_arr = new double [] { 34.4567, 90.1226, 54.9823 };
+
+               char [] c_arr = { 'A', 'B', 'C', 'M', 'R' };
 
+               byte [] b_arr = { 0, 3, 8, 10, 21 };
+
+               sbyte [] s_arr = { 10, 15, 30, 123 };
+               
+               int[,,] ints = new int[,,] { };
+               
+               if (a [2] != 6)
+                       return 1;
+
+               if (s_arr [3] != 123)
+                       return 2;
+               
                if (i [2] != 2)
                        return 1;
                
                if (j [1,1] != 3)
                        return 1;
-               
+
                for (int t = 0; t < 4; ++t) {
                        if (array [t] != t)
                                return 1;
@@ -51,12 +69,43 @@ public class Blah {
                if (boo [0,1] != 11)
                        return 1;
 
+               if (f_array [0] != 1.23F)
+                       return 1;
+
+               if (double_arr [1] != 90.1226)
+                       return 1;
+
                foreach (string s in names)
                        Console.WriteLine ("Hello, " + s);
 
                if (names [0] != "Miguel")
                        return 1;
-               
+
+               if (c_arr [4] != 'R')
+                       return 2;
+
+               int count = 10;
+
+               int [] x = new int [count];
+
+               for (int idx = 0; idx < count; idx++)
+                       x [idx] = idx + 1;
+
+               for (int idx = count; idx > 0; ){
+                       idx--;
+                       if (x [idx] != idx + 1)
+                               return 12;
+               }
+
+               IntPtr [] arr = { new System.IntPtr (1) };
+               if (arr [0] != (IntPtr) 1)
+                        return 13;
+
+                IntPtr [] arr_i = { System.IntPtr.Zero };
+
+                if (arr_i [0] != System.IntPtr.Zero)
+                        return 14;
+                
                Console.WriteLine ("Array initialization test okay.");
                                   
                return 0;