Blame SOURCES/tests-snans-be.patch

c4fa72
Description: Fix sort_snans.js test on big endian
c4fa72
Author: Adrian Bunk <bunk@debian.org>
c4fa72
Bug-Debian: https://bugs.debian.org/878285
c4fa72
c4fa72
--- mozjs52-52.3.1.orig/js/src/tests/ecma_6/TypedArray/sort_snans.js
c4fa72
+++ mozjs52-52.3.1/js/src/tests/ecma_6/TypedArray/sort_snans.js
c4fa72
@@ -34,8 +34,20 @@ function testFloat32NaNRanges(start, end
c4fa72
 // and startHi, startLow and endHi, endLow should be 32-bit integers which,
c4fa72
 // when combined (Hi + Low), form Float64 NaNs.
c4fa72
 function testFloat64NaNRanges(startHi, startLow, endHi, endLow) {
c4fa72
-    let skipN = 10e6;
c4fa72
 
c4fa72
+    // Swap on big endian platforms
c4fa72
+    if ((new Uint32Array((new Uint8Array([1,2,3,4])).buffer))[0] === 0x01020304) {
c4fa72
+	let tmp = startHi;
c4fa72
+	startHi = startLow;
c4fa72
+	startLow = tmp;
c4fa72
+
c4fa72
+	tmp = endHi;
c4fa72
+	endHi = endLow;
c4fa72
+	endLow = tmp;
c4fa72
+    }
c4fa72
+
c4fa72
+    let skipN = 10e6;
c4fa72
+
c4fa72
     let sampleSizeHi  = Math.floor((endHi - startHi)/skipN);
c4fa72
     let sampleSizeLow = Math.floor((endLow - startLow)/skipN);
c4fa72
 
c4fa72