blob: 0a5a221c40d8dd07ba825a42f3fba493495e4063 [file] [log] [blame]
Ben Murdochc5610432016-08-08 18:44:38 +01001// Copyright 2014 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Flags: --allow-natives-syntax --turbo-filter=test2
6
7function test(n) {
8 return Array(n);
9}
10
11function test2() {
12 return test(2);
13}
14
15function test3(a) {
16 a[0] = 1;
17}
18
19test(0);
20
21var smi_array = [1,2];
22smi_array[2] = 3;
23test3(smi_array);
24
25%OptimizeFunctionOnNextCall(test2);
26
27var broken_array = test2();
28test3(broken_array);
291+broken_array[0];