1af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org// Copyright 2014 the V8 project authors. All rights reserved.
2af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org// Redistribution and use in source and binary forms, with or without
3af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org// modification, are permitted provided that the following conditions are
4af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org// met:
5af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org//
6af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org//     * Redistributions of source code must retain the above copyright
7af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org//       notice, this list of conditions and the following disclaimer.
8af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org//     * Redistributions in binary form must reproduce the above
9af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org//       copyright notice, this list of conditions and the following
10af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org//       disclaimer in the documentation and/or other materials provided
11af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org//       with the distribution.
12af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org//     * Neither the name of Google Inc. nor the names of its
13af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org//       contributors may be used to endorse or promote products derived
14af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org//       from this software without specific prior written permission.
15af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org//
16af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org
28af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org// Flags: --allow-natives-syntax
29af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org
30af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.orgfunction f() {
31af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org  %SetAllocationTimeout(1, 0, false);
32af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org  a = new Array(0);
33af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org  assertEquals(0, a.length);
34af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org  assertEquals(0, a.length);
35af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org  %SetAllocationTimeout(-1, -1, true);
36af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org}
37af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org
38af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.orgf();
39af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.orgf();
40af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.org%OptimizeFunctionOnNextCall(f);
41af4fba3c6d2a18866505de3e6798757dd1448c6dmachenbach@chromium.orgf();
42