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:sharedic
18 * @tc.desc:test sharedic
19 * @tc.type: FUNC
20 * @tc.require: issueI8QUU0
21 */
22
23// @ts-nocheck
24/*
25 * Copyright (c) 2023 Huawei Device Co., Ltd.
26 * Licensed under the Apache License, Version 2.0 (the "License");
27 * you may not use this file except in compliance with the License.
28 * You may obtain a copy of the License at
29 *
30 *     http://www.apache.org/licenses/LICENSE-2.0
31 *
32 * Unless required by applicable law or agreed to in writing, software
33 * distributed under the License is distributed on an "AS IS" BASIS,
34 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35 * See the License for the specific language governing permissions and
36 * limitations under the License.
37 */
38
39/*
40 * @tc.name:sharedic
41 * @tc.desc:test sharedic
42 * @tc.type: FUNC
43 * @tc.require: issueI8QUU0
44 */
45
46// @ts-nocheck
47declare function print(str: any): string;
48
49class SFoo {
50  propString: string = "I'm simple sendable's propString";
51  constructor() {
52    "use sendable"
53  }
54  testic() {
55    let a = this;
56    for (var i: number = 0; i < 100; i++) {
57      a.propString = "a" ;
58    }
59  }
60  
61}
62let t = new SFoo();
63t.testic(); // sharedfunction not enter ic
64
65class SClass {
66  str: string = "I'm simple sendable's propString";
67  constructor() {
68    "use sendable"
69  }
70}
71
72let s = new SClass()
73for (var i: number = 0; i < 100; i++) {
74  s.str;
75}
76
77let sobj = new SClass();
78for (let i = 0; i < 200; i++) {
79}
80sobj.__proto__; // not SetProtoCell
81{
82  let arr = new SendableBigUint64Array(5);
83  arr[0]=1n;
84  print(arr[0]);
85}
86
87print("shared ic over");