summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/bug860838-3.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/jit-test/tests/ion/bug860838-3.js
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/jit-test/tests/ion/bug860838-3.js')
-rw-r--r--js/src/jit-test/tests/ion/bug860838-3.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/ion/bug860838-3.js b/js/src/jit-test/tests/ion/bug860838-3.js
new file mode 100644
index 0000000000..a24862bb98
--- /dev/null
+++ b/js/src/jit-test/tests/ion/bug860838-3.js
@@ -0,0 +1,44 @@
+
+var buf = new ArrayBuffer(4096);
+var f64 = new Float64Array(buf);
+var i32 = new Int32Array(buf);
+var u32 = new Uint32Array(buf);
+
+function ffi(d) {
+ str = String(d);
+}
+
+
+function FFI1(glob, imp, b) {
+ "use asm";
+
+ var i8=new glob.Int8Array(b);var u8=new glob.Uint8Array(b);
+ var i16=new glob.Int16Array(b);var u16=new glob.Uint16Array(b);
+ var i32=new glob.Int32Array(b);var u32=new glob.Uint32Array(b);
+ var f32=new glob.Float32Array(b);var f64=new glob.Float64Array(b);
+
+ var ffi=imp.ffi;
+
+ function g() {
+ ffi(+f64[0])
+ }
+ return g
+}
+
+g = FFI1(this, {ffi:ffi}, buf);
+
+
+// that sounds dangerous!
+var a = [0,1,0xffff0000,0x7fff0000,0xfff80000,0x7ff80000,0xfffc0000,0x7ffc0000,0xffffffff,0x0000ffff,0x00008fff7];
+for (i of a) {
+ for (j of a) {
+ u32[0] = i;
+ u32[1] = j;
+
+ print(f64[0]+" (input)");
+ //assertEq(f(), f64[0]);
+
+ g();
+ assertEq(str, String(f64[0]));
+ }
+}