diff --git a/compiler-rt/test/sanitizer_common/ohos_family_commands/ohos_run.py b/compiler-rt/test/sanitizer_common/ohos_family_commands/ohos_run.py index 675e064fa8ffaa6fbfad75c9653e9f569a44ee16..1bdd8ea337710d995397a2a96746c638b3e00bb7 100755 --- a/compiler-rt/test/sanitizer_common/ohos_family_commands/ohos_run.py +++ b/compiler-rt/test/sanitizer_common/ohos_family_commands/ohos_run.py @@ -45,8 +45,8 @@ def build_env(): if san_opt: value += ':abort_on_error=0' if key in ['ASAN_ACTIVATION_OPTIONS', 'SCUDO_OPTIONS'] or san_opt or key == 'LD_LIBRARY_PATH': - if key == 'TSAN_OPTIONS': - # Map TSan suppressions file to device + if key in ['TSAN_OPTIONS', 'UBSAN_OPTIONS']: + # Map TSan or UBSan suppressions file to device value = map_list(value, ':', r'(?<=suppressions=)(.+)', lambda m: (m.group(1), True)) elif key == 'LD_LIBRARY_PATH': # Map LD_LIBRARY_PATH to device diff --git a/compiler-rt/test/ubsan/TestCases/Misc/Linux/lit.local.cfg.py b/compiler-rt/test/ubsan/TestCases/Misc/Linux/lit.local.cfg.py index 57271b8078a49730b9ae06f901ec3faf907dcef5..ce7ce5ddde93dd9896fe163d5c871ef899cb3316 100644 --- a/compiler-rt/test/ubsan/TestCases/Misc/Linux/lit.local.cfg.py +++ b/compiler-rt/test/ubsan/TestCases/Misc/Linux/lit.local.cfg.py @@ -5,5 +5,5 @@ def getRoot(config): root = getRoot(config) -if root.host_os not in ['Linux']: +if root.host_os not in ['Linux', 'OHOS']: # OHOS_LOCAL config.unsupported = True diff --git a/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cpp b/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cpp index 4a94350ec1620d48509a08a1276b2382be84a8a9..e80552ec743419a9d4c590abd7a08438c8e1efc0 100644 --- a/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cpp +++ b/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cpp @@ -21,7 +21,8 @@ // RUN: %env_ubsan_opts=coverage=1:verbosity=1:coverage_dir='"%t-dir"' %run %t 2>&1 | FileCheck %s --check-prefix=CHECK3 --check-prefix=CHECK_WARN // Coverage is not yet implemented in TSan. -// XFAIL: ubsan-tsan +// OHOS_LOCAL +// XFAIL: ubsan-tsan && !ohos_family // UNSUPPORTED: ubsan-standalone-static // No coverage support // UNSUPPORTED: openbsd diff --git a/compiler-rt/test/ubsan/TestCases/Misc/no-interception.cpp b/compiler-rt/test/ubsan/TestCases/Misc/no-interception.cpp index c82fed3bf3f698f71e9b02b2984481e8d259ac35..23ec69459616c86308d71f40ed327dcf95aad14a 100644 --- a/compiler-rt/test/ubsan/TestCases/Misc/no-interception.cpp +++ b/compiler-rt/test/ubsan/TestCases/Misc/no-interception.cpp @@ -10,6 +10,12 @@ // RUN: %clangxx %s -lc -o %t %ld_flags_rpath_exe // RUN: %run %t 2>&1 | FileCheck %s +// OHOS_LOCAL begin +// For OHOS the test build commands result in a runtime error with a missing +// symbol message. +// UNSUPPORTED: ohos_family +// OHOS_LOCAL end + #include int dso_function(int); diff --git a/compiler-rt/test/ubsan/TestCases/TypeCheck/Linux/lit.local.cfg.py b/compiler-rt/test/ubsan/TestCases/TypeCheck/Linux/lit.local.cfg.py index 57271b8078a49730b9ae06f901ec3faf907dcef5..ce7ce5ddde93dd9896fe163d5c871ef899cb3316 100644 --- a/compiler-rt/test/ubsan/TestCases/TypeCheck/Linux/lit.local.cfg.py +++ b/compiler-rt/test/ubsan/TestCases/TypeCheck/Linux/lit.local.cfg.py @@ -5,5 +5,5 @@ def getRoot(config): root = getRoot(config) -if root.host_os not in ['Linux']: +if root.host_os not in ['Linux', 'OHOS']: # OHOS_LOCAL config.unsupported = True diff --git a/compiler-rt/test/ubsan/lit.common.cfg.py b/compiler-rt/test/ubsan/lit.common.cfg.py index 7108561a92c4d3295897a21a4b0d02474345ef36..214833e240d66e1a7898f7642ba842ab5a3f9cc5 100644 --- a/compiler-rt/test/ubsan/lit.common.cfg.py +++ b/compiler-rt/test/ubsan/lit.common.cfg.py @@ -68,7 +68,7 @@ config.substitutions.append( ("%gmlt ", " ".join(config.debug_info_flags) + " ") config.suffixes = ['.c', '.cpp', '.m'] # Check that the host supports UndefinedBehaviorSanitizer tests -if config.host_os not in ['Linux', 'Darwin', 'FreeBSD', 'Windows', 'NetBSD', 'SunOS', 'OpenBSD']: +if config.host_os not in ['Linux', 'Darwin', 'FreeBSD', 'Windows', 'NetBSD', 'SunOS', 'OpenBSD', 'OHOS']: # OHOS_LOCAL config.unsupported = True config.available_features.add('arch=' + config.target_arch) diff --git a/compiler-rt/test/ubsan_minimal/lit.common.cfg.py b/compiler-rt/test/ubsan_minimal/lit.common.cfg.py index 39800c968dbf2800079947dfcdb0aa40f30598dc..3455908413f41d6a19255fde5a7136616c07e3d3 100644 --- a/compiler-rt/test/ubsan_minimal/lit.common.cfg.py +++ b/compiler-rt/test/ubsan_minimal/lit.common.cfg.py @@ -30,7 +30,7 @@ config.substitutions.append( ("%clangxx ", build_invocation(clang_ubsan_cxxflags config.suffixes = ['.c', '.cpp'] # Check that the host supports UndefinedBehaviorSanitizerMinimal tests -if config.host_os not in ['Linux', 'FreeBSD', 'NetBSD', 'Darwin', 'OpenBSD', 'SunOS']: # TODO: Windows +if config.host_os not in ['Linux', 'FreeBSD', 'NetBSD', 'Darwin', 'OpenBSD', 'SunOS', 'OHOS']: # OHOS_LOCAL # TODO: Windows config.unsupported = True # Don't target x86_64h if the test machine can't execute x86_64h binaries.