diff --git a/ets2panda/test/runtime/ets/top_level_statements_order_0.ets b/ets2panda/test/runtime/ets/top_level_statements_order_0.ets new file mode 100644 index 0000000000000000000000000000000000000000..2279019339e36bc0c35314cc92497b6e7a520a66 --- /dev/null +++ b/ets2panda/test/runtime/ets/top_level_statements_order_0.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +let x: Object = new Object() +const y: Object = x; +arktest.assertEQ(y, x); \ No newline at end of file diff --git a/ets2panda/test/runtime/ets/top_level_statements_order_1.ets b/ets2panda/test/runtime/ets/top_level_statements_order_1.ets new file mode 100644 index 0000000000000000000000000000000000000000..2a27b16e63d4cb5cbbb1a7bdf83ef0a94bb8ce79 --- /dev/null +++ b/ets2panda/test/runtime/ets/top_level_statements_order_1.ets @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +let x = [0, 1, 2] +const y = x; +arktest.assertEQ(y[0], 0); +arktest.assertEQ(y[1], 1); +arktest.assertEQ(y[2], 2); \ No newline at end of file