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
16/*
17 * @tc.name:barrier
18 * @tc.desc:test barrier
19 * @tc.type: FUNC
20 * @tc.require: issueIACEAI
21 */
22
23// @ts-nocheck
24declare function print(str: any): string;
25
26print("========== Test Define Sendable Function ==========")
27function fooSendable()
28{
29    // define a sendable func
30    'use sendable'
31    print("fooSendable");
32}
33
34fooSendable()
35
36print("========== Test Define Normal Function ==========")
37function foo()
38{
39    // define a Normal func
40    print("foo");
41}
42
43foo()
44
45print("========== Test IC ==========")
46
47function fun1(n) {
48    function fun2(o) {
49        return o.a;
50    }
51
52    let obj = {a: 1};
53    for (let i = 0; i < n; i++) {
54        fun2(obj);
55    }
56    return fun2(obj);
57}
58
59print(fun1(100));
60print(fun1(1));
61
62
63