1/*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16function test() {
17    let len1 = 2;
18    let len2 = 3000;
19    
20    let array1 = new Float32Array(len1);
21    let array2 = new Float32Array(len2);
22    
23    array1[0] = 1.1;
24    array2[2000] = 2.2;
25}
26
27test()
28print(ArkTools.isAOTCompiled(test))  // pgo:false, aot:true
29
30function test2() {
31    let float32 = new Float32Array([20, 30, 40]);
32    let x = new Float32Array([20, 30, 40]);
33    let y = new Float32Array(x);
34
35    float32[0] = 1.1;
36    x[1] = 2.2;
37    y[2] = 3.3;
38}
39test2();
40print(ArkTools.isAOTCompiled(test2))  // pgo:false, aot:true