Fix return value of ark_aot_compiler

Issue:       IAOZIY
Signed-off-by: sunzibo <sunzibo@huawei.com>
This commit is contained in:
sunzibo 2024-09-05 10:14:51 +08:00
parent ce168b8bc4
commit e16fcd5a4d
7 changed files with 44 additions and 4 deletions

View File

@ -211,7 +211,7 @@ int Main(const int argc, const char **argv)
passManager.CompileValidFiles(generator, ret, compilerStats);
if (compilerStats.GetCompilerMethodCount() == 0) {
return ERR_AN_EMPTY;
return runtimeOptions.IsPartialCompilerMode() ? ERR_AN_EMPTY : ERR_OK;
}
if (!generator.SaveAOTFile(cOptions.outputFileName_ + AOTFileManager::FILE_EXTENSION_AN, appSignature)) {
return ERR_AN_FAIL;

View File

@ -403,6 +403,7 @@ group("ark_aot_ts_assert_test") {
"and",
"array_bounds_check_elimination",
"check_dump",
"empty",
]
foreach(test, assert_test_list) {
deps += [ "${test}:${test}AotAssertAction" ]

View File

@ -0,0 +1,19 @@
# Copyright (c) 2024 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.
import("//arkcompiler/ets_runtime/test/test_helper.gni")
host_aot_assert_test_action("empty") {
deps = []
is_enable_pgo = true
}

View File

@ -0,0 +1,14 @@
/*
* Copyright (c) 2024 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.
*/

View File

@ -14,3 +14,4 @@
[trace] Opcode: LOAD_ELEMENT Count:2
6
7
true

View File

@ -13,3 +13,4 @@
6
7
false

View File

@ -42,6 +42,10 @@ class C3 {
}
const v9 = new C3(SendableMap, '-39635');
let x = "filter"["length"]
x++
print(x)
function testInc() {
let x = "filter"["length"]
x++
print(x)
}
testInc()
print(ArkTools.isAOTCompiled(testInc))