diff --git a/compiler-rt/test/crt/dlclose_ubsan_standalone.cpp b/compiler-rt/test/crt/dlclose_ubsan_standalone.cpp index 65046cbe5893bdab0843fe3701ceef5f44f19478..2b9d276ffcd872df9459e5e0fb7484ab632c3cb5 100644 --- a/compiler-rt/test/crt/dlclose_ubsan_standalone.cpp +++ b/compiler-rt/test/crt/dlclose_ubsan_standalone.cpp @@ -5,6 +5,7 @@ // RUN: %clangxx %s -DRT=\"%device_rundir/libclang_rt.ubsan_standalone.so\" -o %t -ldl // RUN: %push_to_device %shared_ubsan_standalone %device_rundir/libclang_rt.ubsan_standalone.so // RUN: %run %t 2>&1 | FileCheck %s +// REQUIRES: ohos_family #include #include diff --git a/compiler-rt/test/crt/lit.cfg.py b/compiler-rt/test/crt/lit.cfg.py index c8d59edf5eba93b228507159decdb992cd74f371..079937ac7053ffc6e4e1de34b7b77fdce11576c9 100644 --- a/compiler-rt/test/crt/lit.cfg.py +++ b/compiler-rt/test/crt/lit.cfg.py @@ -23,7 +23,7 @@ else: execute_external = (not sys.platform in ['win32']) def get_library_path(file): - cmd = subprocess.Popen([config.clang.strip(), + cmd = subprocess.Popen([config.clang.split()[-1].strip(), # OHOS_LOCAL '-print-file-name=%s' % file] + shlex.split(config.target_cflags), stdout=subprocess.PIPE, @@ -39,7 +39,7 @@ def get_library_path(file): def get_libgcc_file_name(): - cmd = subprocess.Popen([config.clang.strip(), + cmd = subprocess.Popen([config.clang.split()[-1].strip(), # OHOS_LOCAL '-print-libgcc-file-name'] + shlex.split(config.target_cflags), stdout=subprocess.PIPE, @@ -55,8 +55,7 @@ def get_libgcc_file_name(): def build_invocation(compile_flags): - # OHOS_LOCAL - return ' ' + ' '.join([config.compile_wrapper, config.clang] + compile_flags) + ' ' + return ' ' + ' '.join([config.clang] + compile_flags) + ' ' # Setup substitutions. diff --git a/compiler-rt/test/lit.common.cfg.py b/compiler-rt/test/lit.common.cfg.py index a49c3c0bbfdea651830b3caa45a39725fbaa292a..4c43a0b0143ec11957090c0663ae292b1a32554a 100644 --- a/compiler-rt/test/lit.common.cfg.py +++ b/compiler-rt/test/lit.common.cfg.py @@ -518,6 +518,19 @@ if config.android: subprocess.check_call([adb, "shell", "mkdir", "-p", android_tmpdir], env=env) for file in config.android_files_to_push: subprocess.check_call([adb, "push", file, android_tmpdir], env=env) +# OHOS_LOCAL begin + +elif config.host_os == 'OHOS': + env = os.environ.copy() + adb = os.environ.get('ADB', 'adb') + device_tmpdir = '/data/local/tmp/Output/' + config.substitutions.append( ('%device_rundir/', device_tmpdir) ) + config.substitutions.append( ('%push_to_device', "%s push " % adb) ) + config.substitutions.append( ('%adb_shell ', "%s shell " % adb) ) + config.substitutions.append( ('%device_rm', "%s shell 'rm ' " % adb) ) + subprocess.check_call([adb, "shell", "mkdir", "-p", device_tmpdir], env=env) + +# OHOS_LOCAL end else: config.substitutions.append( ('%device_rundir/', "") ) config.substitutions.append( ('%push_to_device', "echo ") ) diff --git a/compiler-rt/test/sanitizer_common/ohos_family_commands/ohos_common.py b/compiler-rt/test/sanitizer_common/ohos_family_commands/ohos_common.py index da6e6b9d2fd43e020e8d3946a0a84f236090d0be..d4a94c03a654d9e2c77feb63e191367a918766fb 100755 --- a/compiler-rt/test/sanitizer_common/ohos_family_commands/ohos_common.py +++ b/compiler-rt/test/sanitizer_common/ohos_family_commands/ohos_common.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + import os, subprocess, tempfile HOS_TMPDIR = '/data/local/tmp/Output' @@ -14,7 +16,7 @@ def host_to_device_path(path): def adb(args, attempts = 1): if verbose: - print args + print (args) tmpname = tempfile.mktemp() out = open(tmpname, 'w') ret = 255 @@ -24,11 +26,11 @@ def adb(args, attempts = 1): if attempts != 0: ret = 5 if ret != 0: - print "adb command failed", args - print tmpname + print ("adb command failed", args) + print (tmpname) out.close() out = open(tmpname, 'r') - print out.read() + print (out.read()) out.close() os.unlink(tmpname) return ret diff --git a/compiler-rt/test/sanitizer_common/ohos_family_commands/ohos_compile.py b/compiler-rt/test/sanitizer_common/ohos_family_commands/ohos_compile.py index 3a4769a5196b7f61093a8d2f77e34d034b28597f..265a4a9f8f09d7416168df5cd848be8045c9d095 100755 --- a/compiler-rt/test/sanitizer_common/ohos_family_commands/ohos_compile.py +++ b/compiler-rt/test/sanitizer_common/ohos_family_commands/ohos_compile.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 import os, sys, subprocess from ohos_common import * @@ -37,7 +37,7 @@ while args: append_args += ['-Wl,--dynamic-linker=' + os.path.join(HOS_TMPDIR, dyld)] if output == None: - print "No output file name!" + print ("No output file name!") sys.exit(1) ret = subprocess.call(sys.argv[1:] + append_args)