From 2662c8c01c3348b2a2b5c02677fc728b6c4a419e Mon Sep 17 00:00:00 2001
From: test262-automation <test262-automation@bocoup.com>
Date: Wed, 28 Nov 2018 19:07:45 +0000
Subject: [PATCH] [javascriptcore-test262-automation] Changes from
 https://github.com/webkit/webkit.git at sha 1966f6a0b8 on Wed Nov 28 2018
 19:04:52 GMT+0000 (Coordinated Universal Time)

---
 .../stress/bit-not-must-generate.js           | 26 ++++++++++++++++
 .../stress/bitwise-not-no-int32.js            | 30 +++++++++++++++++++
 .../javascriptcore/stress/r238510-bad-loop.js | 10 +++++++
 3 files changed, 66 insertions(+)
 create mode 100644 implementation-contributed/javascriptcore/stress/bit-not-must-generate.js
 create mode 100644 implementation-contributed/javascriptcore/stress/bitwise-not-no-int32.js
 create mode 100644 implementation-contributed/javascriptcore/stress/r238510-bad-loop.js

diff --git a/implementation-contributed/javascriptcore/stress/bit-not-must-generate.js b/implementation-contributed/javascriptcore/stress/bit-not-must-generate.js
new file mode 100644
index 0000000000..83fa63b6d9
--- /dev/null
+++ b/implementation-contributed/javascriptcore/stress/bit-not-must-generate.js
@@ -0,0 +1,26 @@
+function assert(a, e) {
+    if (a !== e) {
+        throw new Error("Bad!");
+    }
+}
+
+function foo(a) {
+    let loc = ~a;
+    return a + 2;
+}
+noInline(foo);
+
+let b = 0;
+let o = {
+    valueOf: function () {
+        b++;
+        return 2;
+    }
+};
+
+for (let i = 0; i < 100000; i++) {
+    assert(foo(o), 4);
+}
+
+assert(b, 200000)
+
diff --git a/implementation-contributed/javascriptcore/stress/bitwise-not-no-int32.js b/implementation-contributed/javascriptcore/stress/bitwise-not-no-int32.js
new file mode 100644
index 0000000000..3a29813344
--- /dev/null
+++ b/implementation-contributed/javascriptcore/stress/bitwise-not-no-int32.js
@@ -0,0 +1,30 @@
+function assert(a, e, m) {
+    if (a !== e)
+        throw new Error("Expected to be: " + e + " but got: " + a);
+}
+
+function bitNot(a) {
+    return ~a;
+}
+noInline(bitNot);
+
+for (let i = 0; i < 10000; i++) {
+    let r = bitNot("0");
+    assert(r, -1);
+    r = bitNot("1");
+    assert(r, -2);
+    r = bitNot("-1");
+    assert(r, 0);
+    r = bitNot("-2");
+    assert(r, 1);
+
+    r = bitNot({ valueOf: () => 0 });
+    assert(r, -1);
+    r = bitNot({ valueOf: () => 1 });
+    assert(r, -2);
+    r = bitNot({ valueOf: () => -1 });
+    assert(r, 0);
+    r = bitNot({ valueOf: () => -2 });
+    assert(r, 1);
+}
+
diff --git a/implementation-contributed/javascriptcore/stress/r238510-bad-loop.js b/implementation-contributed/javascriptcore/stress/r238510-bad-loop.js
new file mode 100644
index 0000000000..be899b7d3e
--- /dev/null
+++ b/implementation-contributed/javascriptcore/stress/r238510-bad-loop.js
@@ -0,0 +1,10 @@
+function foo() {
+    return function () {
+        eval();
+    }
+}
+noInline(foo);
+
+for (let i = 0; i < 100000; ++i) {
+    foo();    
+}
-- 
GitLab