Index: test/mjsunit/regress/d8-readbuffer.js |
diff --git a/test/mjsunit/compiler/regress-lbranch-double.js b/test/mjsunit/regress/d8-readbuffer.js |
similarity index 77% |
copy from test/mjsunit/compiler/regress-lbranch-double.js |
copy to test/mjsunit/regress/d8-readbuffer.js |
index dca6d5bace7da4c5f8f20c5b6eb4902da243e40d..8aec02dcac5893c9e4f62da80a77332859fc4fb7 100644 |
--- a/test/mjsunit/compiler/regress-lbranch-double.js |
+++ b/test/mjsunit/regress/d8-readbuffer.js |
@@ -1,4 +1,4 @@ |
-// Copyright 2011 the V8 project authors. All rights reserved. |
+// Copyright 2014 the V8 project authors. All rights reserved. |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
// met: |
@@ -25,16 +25,16 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Flags: --allow-natives-syntax |
+// Test that reading a file actually returns the file's contents. |
-// ARM's code generator for LBranch had a bug, swapping the true/false |
-// branches when the representation of the condition is a double. |
+// Env: TEST_FILE_NAME |
+assertEquals("string", typeof TEST_FILE_NAME); |
-function foo() { |
- return Math.sqrt(2.6415) ? 88 : 99; |
-} |
+var a = new Uint8Array(readbuffer(TEST_FILE_NAME)); |
+ |
+// First line of this file. |
+var expected = "// Copyright 2014 the V8 project authors. All rights reserved."; |
-assertEquals(88, foo()); |
-assertEquals(88, foo()); |
-%OptimizeFunctionOnNextCall(foo) |
-assertEquals(88, foo()); |
+for (var i = 0; i < expected.length; i++) { |
+ assertEquals(expected.charCodeAt(i), a[i]); |
+} |