Index: test/mjsunit/regress/regress-319722-ArrayBuffer.js |
diff --git a/test/cctest/test-cpu-ia32.cc b/test/mjsunit/regress/regress-319722-ArrayBuffer.js |
similarity index 78% |
copy from test/cctest/test-cpu-ia32.cc |
copy to test/mjsunit/regress/regress-319722-ArrayBuffer.js |
index 245450bf92b595e417a53edff09a5849d74dd135..c8aed9e38cf7647836b68ce0428c98b7ba374d6d 100644 |
--- a/test/cctest/test-cpu-ia32.cc |
+++ b/test/mjsunit/regress/regress-319722-ArrayBuffer.js |
@@ -25,16 +25,23 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-#include "v8.h" |
+// Flags: --nostress-opt --allow-natives-syntax |
+var maxSize = %MaxSmi() + 1; |
+var ab = new ArrayBuffer(maxSize); |
-#include "cctest.h" |
-#include "cpu.h" |
- |
-using namespace v8::internal; |
+function TestArray(constr) { |
+ assertThrows(function() { |
+ new constr(ab, 0, maxSize); |
+ }, RangeError); |
+} |
+TestArray(Uint8Array); |
+TestArray(Int8Array); |
+TestArray(Uint16Array); |
+TestArray(Int16Array); |
+TestArray(Uint32Array); |
+TestArray(Int32Array); |
+TestArray(Float32Array); |
+TestArray(Float64Array); |
+TestArray(Uint8ClampedArray); |
-TEST(RequiredFeaturesX64) { |
- // Test for the features required by every x86 CPU in compat/legacy mode. |
- CPU cpu; |
- CHECK(cpu.has_sahf()); |
-} |