[jit] Fix a test which fails on big endian.
authorNeale Ferguson <neale@sinenomine.net>
Thu, 22 Dec 2016 22:09:38 +0000 (17:09 -0500)
committerZoltan Varga <vargaz@gmail.com>
Thu, 22 Dec 2016 22:11:07 +0000 (17:11 -0500)
mono/mini/basic-vectors.cs

index 3e13c2a327fd47d3e15889194771fcc6553ddc0a..a2cf101450e792a1faf5177fdeb7e6b84ad06cbf 100644 (file)
@@ -1044,10 +1044,17 @@ public class VectorTests {
        public static int test_0_vector_t_cast_vector_int32 () {
                var v1 = new Vector<long> (new long [] { 0x123456789abcdef0L, 0x23456789abcdef01L });
                var v = (Vector<int>)v1;
-               if ((uint)v [0] != 0x9abcdef0 || (uint)v [1] != 0x12345678)
-                       return 1;
-               if ((uint)v [2] != 0xabcdef01 || (uint)v [3] != 0x23456789)
-                       return 2;
+               if (BitConverter.IsLittleEndian) {
+                       if ((uint)v [0] != 0x9abcdef0 || (uint)v [1] != 0x12345678)
+                               return 1;
+                       if ((uint)v [2] != 0xabcdef01 || (uint)v [3] != 0x23456789)
+                               return 2;
+               } else {
+                       if ((uint)v [1] != 0x9abcdef0 || (uint)v [0] != 0x12345678)
+                               return 1;
+                       if ((uint)v [3] != 0xabcdef01 || (uint)v [2] != 0x23456789)
+                               return 2;
+               }
                return 0;
        }