diff --git a/plugins/ets/tests/ets_test_suite/CMakeLists.txt b/plugins/ets/tests/ets_test_suite/CMakeLists.txt index 253d1e324aee68636a0e374d639961400652ed40..10e60bc86742e534cf6b6c095653be268cffc54e 100644 --- a/plugins/ets/tests/ets_test_suite/CMakeLists.txt +++ b/plugins/ets/tests/ets_test_suite/CMakeLists.txt @@ -19,3 +19,4 @@ add_subdirectory(lambda) add_subdirectory(gc) add_subdirectory(intrinsics) add_subdirectory(atomics) +add_subdirectory(arrays) diff --git a/plugins/ets/tests/ets_test_suite/arrays/CMakeLists.txt b/plugins/ets/tests/ets_test_suite/arrays/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..63609b4e5aa09e6ac8f550b10f26b7805cad49f7 --- /dev/null +++ b/plugins/ets/tests/ets_test_suite/arrays/CMakeLists.txt @@ -0,0 +1,29 @@ +# Copyright (c) 2021-2022 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. + +set(arrays_tests + class_composite +) + +set(arrays_tests_in_dir "${CMAKE_CURRENT_SOURCE_DIR}") +set(arrays_tests_out_dir "${CMAKE_CURRENT_BINARY_DIR}") + +foreach(test ${arrays_tests}) + set(test_out_dir "${arrays_tests_out_dir}/${test}") + set(test_src "${arrays_tests_in_dir}/${test}.ets") + set(target ets_test_suite_arrays_${test}) + + run_ets_code_verifier(${test_src} ${test_out_dir} ${target}-ets-verifier) + run_int_jit_aot_ets_code(${test_src} ${test_out_dir} ${target}) +endforeach() + diff --git a/plugins/ets/tests/ets_test_suite/arrays/class_composite.ets b/plugins/ets/tests/ets_test_suite/arrays/class_composite.ets new file mode 100644 index 0000000000000000000000000000000000000000..bba2a3548447a2992268354bf14214d3389c5cd0 --- /dev/null +++ b/plugins/ets/tests/ets_test_suite/arrays/class_composite.ets @@ -0,0 +1,7 @@ +class C0 { + x0: boolean +} + +function main() : void { + let x0: C0 = ([{x0: true}])[0] +}