| 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));
|
| }
|
|
|