Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Unified Diff: test/mjsunit/regress/regress-1278.js

Issue 6759025: Version 3.2.6 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/compiler/pic.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-1278.js
diff --git a/test/cctest/test-mips.cc b/test/mjsunit/regress/regress-1278.js
similarity index 64%
rename from test/cctest/test-mips.cc
rename to test/mjsunit/regress/regress-1278.js
index efd4cc975df193710e57ffaa1b9435592e2498c8..7ad8cda7250986b7eb6c2bd7602b13a8253efc81 100644
--- a/test/cctest/test-mips.cc
+++ b/test/mjsunit/regress/regress-1278.js
@@ -25,28 +25,45 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// See: http://code.google.com/p/v8/issues/detail?id=1278
-#include "v8.h"
-#include "execution.h"
+// Test that that handling of 0/-0 is correct for binary operations when the
+// TypeRecordingBinaryOpStub transitions through different states.
-#include "cctest.h"
+function add(x, y) {
+ return x + y;
+}
+
+function sub(x, y) {
+ return x - y;
+}
-using ::v8::Local;
-using ::v8::String;
-using ::v8::Script;
+function mul(x, y) {
+ return x * y;
+}
+
+function div(x, y) {
+ return x / y;
+}
-namespace i = ::v8::internal;
+for (var i = 0; i < 10; i++) {
+ assertEquals(0, add(0, 0));
+ assertEquals(0, add(0, -0));
+ assertEquals(0, add(-0, 0));
+ assertEquals(-0, add(-0, -0));
-TEST(MIPSFunctionCalls) {
- // Disable compilation of natives.
- i::FLAG_disable_native_files = true;
- i::FLAG_full_compiler = false;
+ assertEquals(0, sub(0, 0));
+ assertEquals(0, sub(0, -0));
+ assertEquals(-0, sub(-0, 0));
+ assertEquals(0, sub(-0, -0));
- v8::HandleScope scope;
- LocalContext env; // from cctest.h
+ assertEquals(0, mul(0, 0));
+ assertEquals(-0, mul(0, -0));
+ assertEquals(-0, mul(-0, 0));
+ assertEquals(0, mul(-0, -0));
- const char* c_source = "function foo() { return 0x1234; }; foo();";
- Local<String> source = ::v8::String::New(c_source);
- Local<Script> script = ::v8::Script::Compile(source);
- CHECK_EQ(0x1234, script->Run()->Int32Value());
+ assertEquals(0, div(0, 1));
+ assertEquals(-0, div(0, -1));
+ assertEquals(-0, div(-0, 1));
+ assertEquals(0, div(-0, -1));
}
« no previous file with comments | « test/mjsunit/compiler/pic.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698