diff --git a/compiler-rt/test/asan/CMakeLists.txt b/compiler-rt/test/asan/CMakeLists.txt index 414a6cc9496ed..98fb3fd5ae5fc 100644 --- a/compiler-rt/test/asan/CMakeLists.txt +++ b/compiler-rt/test/asan/CMakeLists.txt @@ -45,6 +45,8 @@ foreach(arch ${ASAN_TEST_ARCH}) set(ASAN_TEST_TARGET_ARCH ${arch}) set(ASAN_TEST_APPLE_PLATFORM "osx") set(ASAN_TEST_MIN_DEPLOYMENT_TARGET_FLAG "${DARWIN_osx_MIN_VER_FLAG}") + set(ASAN_TEST_APPLE_TARGET_IS_HOST ON) + pythonize_bool(ASAN_TEST_APPLE_TARGET_IS_HOST) string(TOLOWER "-${arch}-${OS_NAME}" ASAN_TEST_CONFIG_SUFFIX) get_bits_for_arch(${arch} ASAN_TEST_BITS) get_test_cc_for_arch(${arch} ASAN_TEST_TARGET_CC ASAN_TEST_TARGET_CFLAGS) @@ -113,6 +115,8 @@ if(APPLE) get_capitalized_apple_platform("${platform}" PLATFORM_CAPITALIZED) set(CONFIG_NAME "${PLATFORM_CAPITALIZED}${ARCH_UPPER_CASE}Config") set(ASAN_TEST_CONFIG_SUFFIX "-${arch}-${platform}") + set(ASAN_TEST_APPLE_TARGET_IS_HOST OFF) + pythonize_bool(ASAN_TEST_APPLE_TARGET_IS_HOST) set(ASAN_TEST_APPLE_PLATFORM "${platform}") set(ASAN_TEST_TARGET_ARCH "${arch}") set(ASAN_TEST_MIN_DEPLOYMENT_TARGET_FLAG "${DARWIN_${platform}_MIN_VER_FLAG}") diff --git a/compiler-rt/test/asan/TestCases/Darwin/asan-symbolize-partial-report-no-external-symbolizer.cpp b/compiler-rt/test/asan/TestCases/Darwin/asan-symbolize-partial-report-no-external-symbolizer.cpp index e9b657edcea26..c63fc4ea0ad38 100644 --- a/compiler-rt/test/asan/TestCases/Darwin/asan-symbolize-partial-report-no-external-symbolizer.cpp +++ b/compiler-rt/test/asan/TestCases/Darwin/asan-symbolize-partial-report-no-external-symbolizer.cpp @@ -1,4 +1,4 @@ -// UNSUPPORTED: ios +// UNSUPPORTED: darwin-remote // When `external_symbolizer_path` is empty on Darwin we fallback on using // dladdr as the symbolizer which means we get the symbol name // but no source location. The current implementation also doesn't try to diff --git a/compiler-rt/test/asan/TestCases/Darwin/asan-symbolize-partial-report-with-module-map.cpp b/compiler-rt/test/asan/TestCases/Darwin/asan-symbolize-partial-report-with-module-map.cpp index c9a9c4521b9ae..750df8109029f 100644 --- a/compiler-rt/test/asan/TestCases/Darwin/asan-symbolize-partial-report-with-module-map.cpp +++ b/compiler-rt/test/asan/TestCases/Darwin/asan-symbolize-partial-report-with-module-map.cpp @@ -1,4 +1,4 @@ -// UNSUPPORTED: ios +// UNSUPPORTED: darwin-remote // FIXME(dliew): We currently have to use module map for this test due to the atos // symbolizer changing the module name from an absolute path to just the file name. // rdar://problem/49784442 diff --git a/compiler-rt/test/asan/TestCases/Darwin/asan-symbolize-with-module-map.cpp b/compiler-rt/test/asan/TestCases/Darwin/asan-symbolize-with-module-map.cpp index 56e1e99409c82..7de28b0dfd172 100644 --- a/compiler-rt/test/asan/TestCases/Darwin/asan-symbolize-with-module-map.cpp +++ b/compiler-rt/test/asan/TestCases/Darwin/asan-symbolize-with-module-map.cpp @@ -1,4 +1,4 @@ -// UNSUPPORTED: ios +// UNSUPPORTED: darwin-remote // RUN: %clangxx_asan -O0 -g %s -o %t.executable // Deliberately don't produce the module map and then check that offline symbolization fails diff --git a/compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer-dyld-root-path.cpp b/compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer-dyld-root-path.cpp index 664471b6987a8..9d1a887382b28 100644 --- a/compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer-dyld-root-path.cpp +++ b/compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer-dyld-root-path.cpp @@ -6,8 +6,8 @@ // Due to a bug in atos, this only works on x86_64. // REQUIRES: asan-64-bits -// Path returned by `which atos` is invalid on iOS. -// UNSUPPORTED: ios +// Path returned by `which atos` is invalid on non-host +// UNSUPPORTED: darwin-remote #include #include diff --git a/compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer.cpp b/compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer.cpp index bab4e4f3765c2..cdb733ace1a05 100644 --- a/compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer.cpp +++ b/compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer.cpp @@ -3,8 +3,8 @@ // RUN: %clangxx_asan -O0 %s -o %t // RUN: %env_asan_opts=verbosity=2 ASAN_SYMBOLIZER_PATH=$(which atos) not %run %t 2>&1 | FileCheck %s -// Path returned by `which atos` is invalid on iOS. -// UNSUPPORTED: ios, i386-darwin +// Path returned by `which atos` is invalid on non-host +// UNSUPPORTED: darwin-remote, i386-darwin #include #include diff --git a/compiler-rt/test/asan/TestCases/Darwin/duplicate_os_log_reports.cpp b/compiler-rt/test/asan/TestCases/Darwin/duplicate_os_log_reports.cpp index dd5a257e39855..7e5aae99789a1 100644 --- a/compiler-rt/test/asan/TestCases/Darwin/duplicate_os_log_reports.cpp +++ b/compiler-rt/test/asan/TestCases/Darwin/duplicate_os_log_reports.cpp @@ -1,6 +1,4 @@ -// UNSUPPORTED: ios -// Don't re-enable until rdar://problem/62141527 is fixed. -// REQUIRES: rdar_62141527 +// UNSUPPORTED: darwin-remote // REQUIRES: shell // REQUIRES: darwin_log_cmd // RUN: %clangxx_asan -fsanitize-recover=address %s -o %t @@ -16,6 +14,7 @@ // RUN: FileCheck %s -input-file=%t.process_syslog_output.txt #include #include +#include #include #include diff --git a/compiler-rt/test/asan/TestCases/Darwin/dyld_insert_libraries_reexec.cpp b/compiler-rt/test/asan/TestCases/Darwin/dyld_insert_libraries_reexec.cpp index 0fec18b89411a..dbd0bcc119736 100644 --- a/compiler-rt/test/asan/TestCases/Darwin/dyld_insert_libraries_reexec.cpp +++ b/compiler-rt/test/asan/TestCases/Darwin/dyld_insert_libraries_reexec.cpp @@ -1,7 +1,7 @@ // When DYLD-inserting the ASan dylib from a different location than the // original, make sure we don't try to reexec. -// UNSUPPORTED: ios +// UNSUPPORTED: darwin-remote // RUN: rm -rf %t && mkdir -p %t // RUN: cp `%clang_asan -print-file-name=lib`/darwin/libclang_rt.asan_osx_dynamic.dylib \ diff --git a/compiler-rt/test/asan/TestCases/Darwin/dyld_insert_libraries_remove.cpp b/compiler-rt/test/asan/TestCases/Darwin/dyld_insert_libraries_remove.cpp index 0672e064a1904..92ea524157d45 100644 --- a/compiler-rt/test/asan/TestCases/Darwin/dyld_insert_libraries_remove.cpp +++ b/compiler-rt/test/asan/TestCases/Darwin/dyld_insert_libraries_remove.cpp @@ -2,7 +2,7 @@ // the ASan dylib from the environment variable (both when using an absolute // or relative path) and also that the other dylibs are left untouched. -// UNSUPPORTED: ios +// UNSUPPORTED: darwin-remote // RUN: rm -rf %t && mkdir -p %t // RUN: cp `%clang_asan -print-file-name=lib`/darwin/libclang_rt.asan_osx_dynamic.dylib \ diff --git a/compiler-rt/test/asan/TestCases/Darwin/interface_symbols_darwin.cpp b/compiler-rt/test/asan/TestCases/Darwin/interface_symbols_darwin.cpp index 59dca32672901..9a125c45990ff 100644 --- a/compiler-rt/test/asan/TestCases/Darwin/interface_symbols_darwin.cpp +++ b/compiler-rt/test/asan/TestCases/Darwin/interface_symbols_darwin.cpp @@ -47,6 +47,6 @@ // RUN: echo "=== NOTE === If you see a mismatch below, please update sanitizer_interface.inc files." // RUN: diff %t.imports-sorted %t.exports-sorted -// UNSUPPORTED: ios +// UNSUPPORTED: darwin-remote int main() { return 0; } diff --git a/compiler-rt/test/asan/TestCases/Darwin/suppressions-sandbox.cpp b/compiler-rt/test/asan/TestCases/Darwin/suppressions-sandbox.cpp index 651d0c5d05b07..49ac9f756a8b3 100644 --- a/compiler-rt/test/asan/TestCases/Darwin/suppressions-sandbox.cpp +++ b/compiler-rt/test/asan/TestCases/Darwin/suppressions-sandbox.cpp @@ -9,8 +9,8 @@ // Check that suppressing a function name works within a no-fork sandbox // RUN: echo "interceptor_via_fun:createCFString" > %t.supp // RUN: %env_asan_opts=suppressions='"%t.supp"' \ -// RUN: sandbox-exec -p '(version 1)(allow default)(deny process-fork)' \ -// RUN: %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s +// RUN: %run sandbox-exec -p '(version 1)(allow default)(deny process-fork)' \ +// RUN: %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s // sandbox-exec isn't available on iOS // UNSUPPORTED: ios diff --git a/compiler-rt/test/asan/TestCases/Darwin/uuid.cpp b/compiler-rt/test/asan/TestCases/Darwin/uuid.cpp index ba2d4494d3dac..1b7e60070313d 100644 --- a/compiler-rt/test/asan/TestCases/Darwin/uuid.cpp +++ b/compiler-rt/test/asan/TestCases/Darwin/uuid.cpp @@ -4,8 +4,8 @@ // RUN: %clangxx_asan %s -o %t -fsanitize-recover=address // RUN: %env_asan_opts=print_module_map=2:halt_on_error=0 %run %t 2>&1 | FileCheck %s -// We can't run system("otool") in the simulator. -// UNSUPPORTED: ios +// We can't run system("otool") on remote devices. +// UNSUPPORTED: darwin-remote #include #include diff --git a/compiler-rt/test/asan/TestCases/Posix/asan-symbolize-sanity-test.cpp b/compiler-rt/test/asan/TestCases/Posix/asan-symbolize-sanity-test.cpp index 5d3e7a767e45a..ab57400b78c58 100644 --- a/compiler-rt/test/asan/TestCases/Posix/asan-symbolize-sanity-test.cpp +++ b/compiler-rt/test/asan/TestCases/Posix/asan-symbolize-sanity-test.cpp @@ -9,7 +9,7 @@ // RUN: %env_asan_opts=symbolize=0 not %run %t 2>&1 | %asan_symbolize | FileCheck %s // REQUIRES: stable-runtime -// UNSUPPORTED: ios +// UNSUPPORTED: darwin-remote #if !defined(SHARED_LIB) #include diff --git a/compiler-rt/test/asan/TestCases/Posix/asan_symbolize_script/plugin_wrong_frame_number_bug.cpp b/compiler-rt/test/asan/TestCases/Posix/asan_symbolize_script/plugin_wrong_frame_number_bug.cpp index c3383d6082b44..6c71660f37541 100644 --- a/compiler-rt/test/asan/TestCases/Posix/asan_symbolize_script/plugin_wrong_frame_number_bug.cpp +++ b/compiler-rt/test/asan/TestCases/Posix/asan_symbolize_script/plugin_wrong_frame_number_bug.cpp @@ -1,7 +1,7 @@ // This test case checks for an old bug when using plug-ins that caused // the stack numbering to be incorrect. // UNSUPPORTED: android -// UNSUPPORTED: ios +// UNSUPPORTED: darwin-remote // RUN: %clangxx_asan -O0 -g %s -o %t // RUN: %env_asan_opts=symbolize=0 not %run %t DUMMY_ARG > %t.asan_report 2>&1 diff --git a/compiler-rt/test/asan/TestCases/Posix/coverage.cpp b/compiler-rt/test/asan/TestCases/Posix/coverage.cpp index 12a88402eb5aa..b7c2d5d67f4f7 100644 --- a/compiler-rt/test/asan/TestCases/Posix/coverage.cpp +++ b/compiler-rt/test/asan/TestCases/Posix/coverage.cpp @@ -18,7 +18,7 @@ // // https://code.google.com/p/address-sanitizer/issues/detail?id=263 // XFAIL: android -// UNSUPPORTED: ios +// UNSUPPORTED: darwin-remote #include #include diff --git a/compiler-rt/test/asan/TestCases/Posix/new_array_cookie_with_new_from_class.cpp b/compiler-rt/test/asan/TestCases/Posix/new_array_cookie_with_new_from_class.cpp index ec91b6597fbe7..23d65100f96a8 100644 --- a/compiler-rt/test/asan/TestCases/Posix/new_array_cookie_with_new_from_class.cpp +++ b/compiler-rt/test/asan/TestCases/Posix/new_array_cookie_with_new_from_class.cpp @@ -4,7 +4,7 @@ // // XFAIL: target=arm{{.*}} -// UNSUPPORTED: ios +// UNSUPPORTED: darwin-remote #include #include diff --git a/compiler-rt/test/asan/TestCases/default_ignorelist.cpp b/compiler-rt/test/asan/TestCases/default_ignorelist.cpp index c1277394680f1..afdd6ca4ffcc6 100644 --- a/compiler-rt/test/asan/TestCases/default_ignorelist.cpp +++ b/compiler-rt/test/asan/TestCases/default_ignorelist.cpp @@ -1,6 +1,6 @@ // FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // XFAIL: android, msvc -// UNSUPPORTED: ios +// UNSUPPORTED: darwin-remote // // Test that ASan uses the default ignorelist from resource directory. // RUN: %clangxx_asan -### %s 2>&1 | FileCheck %s diff --git a/compiler-rt/test/asan/TestCases/log-path_test.cpp b/compiler-rt/test/asan/TestCases/log-path_test.cpp index 3c5ca114cfd71..8717e63d8f072 100644 --- a/compiler-rt/test/asan/TestCases/log-path_test.cpp +++ b/compiler-rt/test/asan/TestCases/log-path_test.cpp @@ -1,6 +1,6 @@ // FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316 // XFAIL: android -// UNSUPPORTED: ios +// UNSUPPORTED: darwin-remote // // The for loop in the backticks below requires bash. // REQUIRES: shell diff --git a/compiler-rt/test/asan/TestCases/suppressions-exec-relative-location.cpp b/compiler-rt/test/asan/TestCases/suppressions-exec-relative-location.cpp index 0a028e2ebed6d..dbe9e71d2ca8e 100644 --- a/compiler-rt/test/asan/TestCases/suppressions-exec-relative-location.cpp +++ b/compiler-rt/test/asan/TestCases/suppressions-exec-relative-location.cpp @@ -25,7 +25,7 @@ // FIXME: Upload suppressions to device. // XFAIL: android -// UNSUPPORTED: ios +// UNSUPPORTED: darwin-remote #include #include diff --git a/compiler-rt/test/asan/lit.site.cfg.py.in b/compiler-rt/test/asan/lit.site.cfg.py.in index afecfafeb99f9..6726df61eef74 100644 --- a/compiler-rt/test/asan/lit.site.cfg.py.in +++ b/compiler-rt/test/asan/lit.site.cfg.py.in @@ -8,6 +8,7 @@ config.bits = "@ASAN_TEST_BITS@" config.arm_thumb = "@COMPILER_RT_ARM_THUMB@" config.apple_platform = "@ASAN_TEST_APPLE_PLATFORM@" config.apple_platform_min_deployment_target_flag = "@ASAN_TEST_MIN_DEPLOYMENT_TARGET_FLAG@" +config.apple_target_is_host = @ASAN_TEST_APPLE_TARGET_IS_HOST_PYBOOL@ config.asan_dynamic = @ASAN_TEST_DYNAMIC@ config.target_arch = "@ASAN_TEST_TARGET_ARCH@" diff --git a/compiler-rt/test/asan_abi/CMakeLists.txt b/compiler-rt/test/asan_abi/CMakeLists.txt index 51c7980459113..1df86c683af5f 100644 --- a/compiler-rt/test/asan_abi/CMakeLists.txt +++ b/compiler-rt/test/asan_abi/CMakeLists.txt @@ -20,6 +20,8 @@ foreach(arch ${ASAN_ABI_TEST_ARCH}) set(ASAN_ABI_TEST_TARGET_ARCH ${arch}) set(ASAN_ABI_TEST_APPLE_PLATFORM "osx") set(ASAN_ABI_TEST_MIN_DEPLOYMENT_TARGET_FLAG "${DARWIN_osx_MIN_VER_FLAG}") + set(ASAN_ABI_TEST_APPLE_TARGET_IS_HOST ON) + pythonize_bool(ASAN_ABI_TEST_APPLE_TARGET_IS_HOST) string(TOLOWER "-${arch}-${OS_NAME}" ASAN_ABI_TEST_CONFIG_SUFFIX) get_bits_for_arch(${arch} ASAN_ABI_TEST_BITS) get_test_cc_for_arch(${arch} ASAN_ABI_TEST_TARGET_CC ASAN_ABI_TEST_TARGET_CFLAGS) @@ -61,6 +63,8 @@ if(APPLE) set(ASAN_ABI_TEST_APPLE_PLATFORM "${platform}") set(ASAN_ABI_TEST_TARGET_ARCH "${arch}") set(ASAN_ABI_TEST_MIN_DEPLOYMENT_TARGET_FLAG "${DARWIN_${platform}_MIN_VER_FLAG}") + set(ASAN_ABI_TEST_APPLE_TARGET_IS_HOST OFF) + pythonize_bool(ASAN_ABI_TEST_APPLE_TARGET_IS_HOST) get_bits_for_arch(${arch} ASAN_ABI_TEST_BITS) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in diff --git a/compiler-rt/test/asan_abi/lit.site.cfg.py.in b/compiler-rt/test/asan_abi/lit.site.cfg.py.in index 0261159b664a2..33ab08c24d250 100644 --- a/compiler-rt/test/asan_abi/lit.site.cfg.py.in +++ b/compiler-rt/test/asan_abi/lit.site.cfg.py.in @@ -8,6 +8,7 @@ config.bits = "@ASAN_ABI_TEST_BITS@" config.arm_thumb = "@COMPILER_RT_ARM_THUMB@" config.apple_platform = "@ASAN_ABI_TEST_APPLE_PLATFORM@" config.apple_platform_min_deployment_target_flag = "@ASAN_ABI_TEST_MIN_DEPLOYMENT_TARGET_FLAG@" +config.apple_target_is_host = @ASAN_ABI_TEST_APPLE_TARGET_IS_HOST_PYBOOL@ config.target_arch = "@ASAN_ABI_TEST_TARGET_ARCH@" # Load common config for all compiler-rt lit tests. diff --git a/compiler-rt/test/fuzzer/CMakeLists.txt b/compiler-rt/test/fuzzer/CMakeLists.txt index 51021e2dc2d99..8228743816ce1 100644 --- a/compiler-rt/test/fuzzer/CMakeLists.txt +++ b/compiler-rt/test/fuzzer/CMakeLists.txt @@ -50,6 +50,8 @@ macro(test_fuzzer stdlib) set(LIBFUZZER_TEST_TARGET_ARCH ${arch}) set(LIBFUZZER_TEST_APPLE_PLATFORM "osx") + set(LIBFUZZER_TEST_APPLE_TARGET_IS_HOST ON) + pythonize_bool(LIBFUZZER_TEST_APPLE_TARGET_IS_HOST) set(LIBFUZZER_TEST_MIN_DEPLOYMENT_TARGET_FLAG "${DARWIN_osx_MIN_VER_FLAG}") set(LIBFUZZER_TEST_STDLIB ${stdlib}) @@ -111,6 +113,8 @@ if (APPLE) set(CONFIG_NAME "${PLATFORM_CAPITALIZED}${ARCH_UPPER_CASE}Config") set(LIBFUZZER_TEST_CONFIG_SUFFIX "-${arch}-${platform}") set(LIBFUZZER_TEST_APPLE_PLATFORM "${platform}") + set(LIBFUZZER_TEST_APPLE_TARGET_IS_HOST OFF) + pythonize_bool(LIBFUZZER_TEST_APPLE_TARGET_IS_HOST) set(LIBFUZZER_TEST_TARGET_ARCH "${arch}") set(LIBFUZZER_TEST_MIN_DEPLOYMENT_TARGET_FLAG "${DARWIN_${platform}_MIN_VER_FLAG}") configure_lit_site_cfg( diff --git a/compiler-rt/test/fuzzer/afl-driver-stderr.test b/compiler-rt/test/fuzzer/afl-driver-stderr.test index 4b0c3b40221af..c8a0e15d992ec 100644 --- a/compiler-rt/test/fuzzer/afl-driver-stderr.test +++ b/compiler-rt/test/fuzzer/afl-driver-stderr.test @@ -1,6 +1,6 @@ # AFL doesn't work on Windows. No reason to test the driver. UNSUPPORTED: target={{.*(freebsd|windows).*}} -XFAIL: ios +XFAIL: darwin-remote RUN: %no_fuzzer_cpp_compiler %S/AFLDriverTest.cpp %libfuzzer_src/afl/afl_driver.cpp -o %t-AFLDriverTest ; Test that not specifying a stderr file isn't broken. diff --git a/compiler-rt/test/fuzzer/big-file-copy.test b/compiler-rt/test/fuzzer/big-file-copy.test index 9565ed4e0bca2..383190435056d 100644 --- a/compiler-rt/test/fuzzer/big-file-copy.test +++ b/compiler-rt/test/fuzzer/big-file-copy.test @@ -1,5 +1,5 @@ REQUIRES: darwin -UNSUPPORTED: ios +UNSUPPORTED: darwin-remote RUN: %cpp_compiler %S/BigFileCopy.cpp -o %t RUN: %run %t -runs=1 -rss_limit_mb=4096 2>big-file-out.txt; result=$? RUN: %run rm -f big-file.txt big-file-out.txt diff --git a/compiler-rt/test/fuzzer/cross_over.test b/compiler-rt/test/fuzzer/cross_over.test index 5fc3b060b308f..f9f3e9c1188a3 100644 --- a/compiler-rt/test/fuzzer/cross_over.test +++ b/compiler-rt/test/fuzzer/cross_over.test @@ -1,5 +1,5 @@ # For IOS, we fail to permute the run lines properly (rdar://99889376) -XFAIL: ios && !iossim +XFAIL: darwin-remote && !iossim # Tests CrossOverTest. # We want to make sure that the test can find the input # ABCDEFGHIJ when given two other inputs in the seed corpus: diff --git a/compiler-rt/test/fuzzer/lit.site.cfg.py.in b/compiler-rt/test/fuzzer/lit.site.cfg.py.in index 8c403a2719a77..3521b051b89df 100644 --- a/compiler-rt/test/fuzzer/lit.site.cfg.py.in +++ b/compiler-rt/test/fuzzer/lit.site.cfg.py.in @@ -6,6 +6,7 @@ config.c_compiler = "@LIBFUZZER_TEST_COMPILER@" config.stdlib = "@LIBFUZZER_TEST_STDLIB@" config.apple_platform = "@LIBFUZZER_TEST_APPLE_PLATFORM@" config.apple_platform_min_deployment_target_flag = "@LIBFUZZER_TEST_MIN_DEPLOYMENT_TARGET_FLAG@" +config.apple_target_is_host = @LIBFUZZER_TEST_APPLE_TARGET_IS_HOST_PYBOOL@ config.name_suffix = "@LIBFUZZER_TEST_CONFIG_SUFFIX@" config.arm_thumb = "@COMPILER_RT_ARM_THUMB@" diff --git a/compiler-rt/test/fuzzer/merge-control-file.test b/compiler-rt/test/fuzzer/merge-control-file.test index c7d666ea471e9..294ba0eb0a3c1 100644 --- a/compiler-rt/test/fuzzer/merge-control-file.test +++ b/compiler-rt/test/fuzzer/merge-control-file.test @@ -1,5 +1,5 @@ # For IOS, we fail to permute the run lines properly (rdar://99889376) -XFAIL: ios && !iossim +XFAIL: darwin-remote && !iossim RUN: mkdir -p %t # Use a ".exe" extension because it is needed on Windows to call system() # to execute itself again. diff --git a/compiler-rt/test/fuzzer/merge-posix.test b/compiler-rt/test/fuzzer/merge-posix.test index 2721668fb9706..46172e4891999 100644 --- a/compiler-rt/test/fuzzer/merge-posix.test +++ b/compiler-rt/test/fuzzer/merge-posix.test @@ -1,5 +1,5 @@ REQUIRES: shell -XFAIL: ios +XFAIL: darwin-remote RUN: %cpp_compiler %S/FullCoverageSetTest.cpp -o %t-FullCoverageSetTest RUN: rm -rf %tmp/T1 %tmp/T2 diff --git a/compiler-rt/test/fuzzer/seed_inputs.test b/compiler-rt/test/fuzzer/seed_inputs.test index 45cec5ed50164..6b303d408844a 100644 --- a/compiler-rt/test/fuzzer/seed_inputs.test +++ b/compiler-rt/test/fuzzer/seed_inputs.test @@ -1,5 +1,5 @@ # Uses echo in a way that is not supported by the iOS "run-on-device" script. -UNSUPPORTED: ios +UNSUPPORTED: darwin-remote RUN: %cpp_compiler %S/SimpleTest.cpp -o %t-SimpleTest diff --git a/compiler-rt/test/lit.common.cfg.py b/compiler-rt/test/lit.common.cfg.py index 9a48ff9ef7d94..7f606aaf495d4 100644 --- a/compiler-rt/test/lit.common.cfg.py +++ b/compiler-rt/test/lit.common.cfg.py @@ -413,7 +413,7 @@ def get_ios_commands_dir(): lit_config.warning("%device_rm is not implemented") config.substitutions.append(("%device_rm", "echo ")) config.compile_wrapper = "" -elif config.host_os == "Darwin" and config.apple_platform != "osx": +elif config.host_os == "Darwin" and not config.apple_target_is_host: # Darwin tests can be targetting macOS, a device or a simulator. All devices # are declared as "ios", even for iOS derivatives (tvOS, watchOS). Similarly, # all simulators are "iossim". See the table below. @@ -421,18 +421,25 @@ def get_ios_commands_dir(): # ========================================================================= # Target | Feature set # ========================================================================= - # macOS | darwin - # iOS device | darwin, ios - # iOS simulator | darwin, ios, iossim - # tvOS device | darwin, ios, tvos - # tvOS simulator | darwin, ios, iossim, tvos, tvossim - # watchOS device | darwin, ios, watchos - # watchOS simulator | darwin, ios, iossim, watchos, watchossim + # macOS host | darwin + # macOS device | darwin, darwin-remote + # iOS device | darwin, darwin-remote, ios + # iOS simulator | darwin, darwin-remote, ios, iossim + # tvOS device | darwin, darwin-remote, ios, tvos + # tvOS simulator | darwin, darwin-remote, ios, iossim, tvos, tvossim + # watchOS device | darwin, darwin-remote, ios, watchos + # watchOS simulator | darwin, darwin-remote, ios, iossim, watchos, watchossim # ========================================================================= + # All suites that aren't running on the host get the darwin-remote feature. + config.available_features.add("darwin-remote") + + # All non-OSX targets have the ios feature (see the above table) + if config.apple_platform != "osx": + config.available_features.add("ios") + ios_or_iossim = "iossim" if config.apple_platform.endswith("sim") else "ios" - config.available_features.add("ios") device_id_env = "SANITIZER_" + ios_or_iossim.upper() + "_TEST_DEVICE_IDENTIFIER" if ios_or_iossim == "iossim": config.available_features.add("iossim") diff --git a/compiler-rt/test/lit.common.configured.in b/compiler-rt/test/lit.common.configured.in index 04d1a4df5a54f..43db3c65cab0b 100644 --- a/compiler-rt/test/lit.common.configured.in +++ b/compiler-rt/test/lit.common.configured.in @@ -2,7 +2,7 @@ # Set attribute value if it is unset. def set_default(attr, value): - if not getattr(config, attr, None): + if getattr(config, attr, "") == "": setattr(config, attr, value) # Generic config options for all compiler-rt lit tests. @@ -35,6 +35,7 @@ set_default("asan_shadow_scale", "@COMPILER_RT_ASAN_SHADOW_SCALE@") set_default("memprof_shadow_scale", "@COMPILER_RT_MEMPROF_SHADOW_SCALE@") set_default("apple_platform", "osx") set_default("apple_platform_min_deployment_target_flag", "-mmacosx-version-min") +set_default("apple_target_is_host", True) set_default("sanitizer_can_use_cxxabi", @SANITIZER_CAN_USE_CXXABI_PYBOOL@) set_default("sanitizer_uses_static_cxxabi", @SANITIZER_USE_STATIC_CXX_ABI_PYBOOL@) set_default("sanitizer_uses_static_unwind", @SANITIZER_USE_STATIC_LLVM_UNWINDER_PYBOOL@) diff --git a/compiler-rt/test/sanitizer_common/CMakeLists.txt b/compiler-rt/test/sanitizer_common/CMakeLists.txt index 615666676f57a..ddc537e35fdbd 100644 --- a/compiler-rt/test/sanitizer_common/CMakeLists.txt +++ b/compiler-rt/test/sanitizer_common/CMakeLists.txt @@ -65,8 +65,6 @@ foreach(tool ${SUPPORTED_TOOLS}) list(REMOVE_ITEM TEST_ARCH x86_64) endif() - # TODO(dliew): We should iterate over the different - # Apple platforms, not just macOS. foreach(arch ${TEST_ARCH}) set(SANITIZER_COMMON_LIT_TEST_MODE ${tool}) set(SANITIZER_COMMON_TEST_TARGET_ARCH ${arch}) @@ -84,6 +82,9 @@ foreach(tool ${SUPPORTED_TOOLS}) "${SANITIZER_COMMON_TEST_TARGET_CFLAGS}") endif() + set(SANITIZER_COMMON_TEST_APPLE_TARGET_IS_HOST ON) + pythonize_bool(SANITIZER_COMMON_TEST_APPLE_TARGET_IS_HOST) + configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py) @@ -98,6 +99,62 @@ foreach(tool ${SUPPORTED_TOOLS}) endforeach() endforeach() +# iOS and iOS simulator test suites +# These are not added into "check-all", in order to run these tests, use +# "check-sanitizer-iossim-arm64" and similar. They also require an extra environment +# variable to select which iOS device or simulator to use, e.g.: +# SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER="iPhone 16" +if(APPLE) + set(SANITIZER_APPLE_PLATFORMS ${SANITIZER_COMMON_SUPPORTED_OS}) + + foreach(platform ${SANITIZER_APPLE_PLATFORMS}) + if ("${platform}" STREQUAL "osx") + # Skip macOS because it's handled by the code above that builds tests for the host machine. + continue() + endif() + list_intersect( + SANITIZER_COMMON_TEST_${platform}_ARCHS + ALL_SANITIZER_COMMON_SUPPORTED_ARCH + DARWIN_${platform}_ARCHS + ) + foreach(arch ${SANITIZER_COMMON_TEST_${platform}_ARCHS}) + set(SANITIZER_COMMON_TESTSUITES_${platform}_${arch}) + foreach(tool ${SUPPORTED_TOOLS}) + if ("${tool}" STREQUAL "lsan") + continue() + endif() + + set(SANITIZER_COMMON_LIT_TEST_MODE ${tool}) + + get_test_cflags_for_apple_platform( + "${platform}" + "${arch}" + SANITIZER_COMMON_TEST_TARGET_CFLAGS) + set(CONFIG_NAME "${tool}-${arch}-${platform}") + set(SANITIZER_COMMON_TEST_CONFIG_SUFFIX "-${arch}-${platform}") + set(SANITIZER_COMMON_TEST_APPLE_PLATFORM "${platform}") + set(SANITIZER_COMMON_TEST_APPLE_TARGET_IS_HOST OFF) + pythonize_bool(SANITIZER_COMMON_TEST_APPLE_TARGET_IS_HOST) + set(SANITIZER_COMMON_TEST_TARGET_ARCH "${arch}") + set(SANITIZER_COMMON_TEST_MIN_DEPLOYMENT_TARGET_FLAG "${DARWIN_${platform}_MIN_VER_FLAG}") + configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py) + + list(APPEND SANITIZER_COMMON_TESTSUITES_${platform}_${arch} + ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) + endforeach() + + add_lit_testsuite(check-sanitizer-${platform}-${arch} + "sanitizer-common ${platform} ${arch} tests" + ${SANITIZER_COMMON_TESTSUITES_${platform}_${arch}} + EXCLUDE_FROM_CHECK_ALL + DEPENDS ${SANITIZER_COMMON_TEST_DEPS}) + endforeach() + endforeach() +endif() + + # Unit tests. configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.py.in diff --git a/compiler-rt/test/sanitizer_common/TestCases/Darwin/print-stack-trace-in-code-loaded-after-fork.cpp b/compiler-rt/test/sanitizer_common/TestCases/Darwin/print-stack-trace-in-code-loaded-after-fork.cpp index ec8155365496e..2c32dcb296528 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Darwin/print-stack-trace-in-code-loaded-after-fork.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/Darwin/print-stack-trace-in-code-loaded-after-fork.cpp @@ -6,6 +6,8 @@ // rdar://problem/61793759 and rdar://problem/62126022. // UNSUPPORTED: lsan +// XFAIL: iossim + #include #ifdef SHARED_LIB diff --git a/compiler-rt/test/sanitizer_common/TestCases/Darwin/symbolizer-function-offset-atos.cpp b/compiler-rt/test/sanitizer_common/TestCases/Darwin/symbolizer-function-offset-atos.cpp index da1bf2cdcf252..a4535047b2ac7 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Darwin/symbolizer-function-offset-atos.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/Darwin/symbolizer-function-offset-atos.cpp @@ -33,7 +33,7 @@ int main() { return 0; } -// CHECK: Using atos found at: +// CHECK: {{Using atos (found at|at user-specified path):}} // These `function_offset` patterns are designed to disallow `0x0` which is the // value printed for `kUnknown`. diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/popen.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/popen.cpp index 6bf6255a697a1..1cc7908086c6f 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Posix/popen.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/popen.cpp @@ -2,6 +2,8 @@ // CHECK: 1 // CHECK-NEXT: 2 +// XFAIL: iossim + #include #include diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/posix_spawn.c b/compiler-rt/test/sanitizer_common/TestCases/Posix/posix_spawn.c index ea58b92af6097..e30c9266b8604 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Posix/posix_spawn.c +++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/posix_spawn.c @@ -3,6 +3,10 @@ // Older versions of Android do not have certain posix_spawn* functions. // UNSUPPORTED: android +// Simulators expect certain envars to be set, but this test overwrites +// env when spawning the child process. +// XFAIL: iossim + #include #include #include diff --git a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cpp b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cpp index 84c28e82f04ac..3797c469eb186 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/sanitizer_coverage_trace_pc_guard.cpp @@ -6,6 +6,7 @@ // UNSUPPORTED: x86_64h-darwin && lsan // XFAIL: tsan // XFAIL: android && asan +// XFAIL: darwin-remote // RUN: rm -rf %t_workdir // RUN: mkdir -p %t_workdir diff --git a/compiler-rt/test/sanitizer_common/TestCases/suffix-log-path_test.c b/compiler-rt/test/sanitizer_common/TestCases/suffix-log-path_test.c index 8e131054c2d4d..222884dfb36a2 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/suffix-log-path_test.c +++ b/compiler-rt/test/sanitizer_common/TestCases/suffix-log-path_test.c @@ -8,7 +8,7 @@ // RUN: %env_tool_opts=log_path=%T/sanitizer.log:log_exe_name=1:log_suffix=.txt %run %T/suffix-log-path_test-binary 2> %t.out // RUN: FileCheck %s < %T/sanitizer.log.suffix-log-path_test-binary.*.txt -// UNSUPPORTED: ios, android +// UNSUPPORTED: darwin-remote, android #include #include diff --git a/compiler-rt/test/sanitizer_common/lit.site.cfg.py.in b/compiler-rt/test/sanitizer_common/lit.site.cfg.py.in index e2db9482f9164..753bb8d1c68a4 100644 --- a/compiler-rt/test/sanitizer_common/lit.site.cfg.py.in +++ b/compiler-rt/test/sanitizer_common/lit.site.cfg.py.in @@ -4,6 +4,9 @@ config.name_suffix = "@CONFIG_NAME@" config.tool_name = "@SANITIZER_COMMON_LIT_TEST_MODE@" config.target_cflags = "@SANITIZER_COMMON_TEST_TARGET_CFLAGS@" +config.apple_platform = "@SANITIZER_COMMON_TEST_APPLE_PLATFORM@" +config.apple_platform_min_deployment_target_flag = "@SANITIZER_COMMON_TEST_MIN_DEPLOYMENT_TARGET_FLAG@" +config.apple_target_is_host = @SANITIZER_COMMON_TEST_APPLE_TARGET_IS_HOST_PYBOOL@ config.target_arch = "@SANITIZER_COMMON_TEST_TARGET_ARCH@" config.arm_thumb = "@COMPILER_RT_ARM_THUMB@" diff --git a/compiler-rt/test/tsan/CMakeLists.txt b/compiler-rt/test/tsan/CMakeLists.txt index 163355d68ebc2..4cd88507a2baf 100644 --- a/compiler-rt/test/tsan/CMakeLists.txt +++ b/compiler-rt/test/tsan/CMakeLists.txt @@ -31,6 +31,8 @@ endif() foreach(arch ${TSAN_TEST_ARCH}) set(TSAN_TEST_APPLE_PLATFORM "osx") set(TSAN_TEST_MIN_DEPLOYMENT_TARGET_FLAG "${DARWIN_osx_MIN_VER_FLAG}") + set(TSAN_TEST_APPLE_TARGET_IS_HOST ON) + pythonize_bool(TSAN_TEST_APPLE_TARGET_IS_HOST) set(TSAN_TEST_TARGET_ARCH ${arch}) string(TOLOWER "-${arch}" TSAN_TEST_CONFIG_SUFFIX) @@ -97,6 +99,8 @@ if(APPLE) set(CONFIG_NAME "${PLATFORM_CAPITALIZED}${ARCH_UPPER_CASE}Config") set(TSAN_TEST_CONFIG_SUFFIX "-${arch}-${platform}") set(TSAN_TEST_APPLE_PLATFORM "${platform}") + set(TSAN_TEST_APPLE_TARGET_IS_HOST OFF) + pythonize_bool(TSAN_TEST_APPLE_TARGET_IS_HOST) set(TSAN_TEST_TARGET_ARCH "${arch}") set(TSAN_TEST_MIN_DEPLOYMENT_TARGET_FLAG "${DARWIN_${platform}_MIN_VER_FLAG}") configure_lit_site_cfg( diff --git a/compiler-rt/test/tsan/Darwin/dlopen.cpp b/compiler-rt/test/tsan/Darwin/dlopen.cpp index 3d12b815f9c25..3b1d4d6eb5668 100644 --- a/compiler-rt/test/tsan/Darwin/dlopen.cpp +++ b/compiler-rt/test/tsan/Darwin/dlopen.cpp @@ -4,7 +4,7 @@ // REQUIRES: osx-autointerception -// XFAIL: ios +// XFAIL: darwin-remote // RUN: %clangxx_tsan %s -o %t.so -shared -DSHARED_LIB // RUN: %clangxx_tsan -fno-sanitize=thread %s -o %t diff --git a/compiler-rt/test/tsan/Darwin/dyld-insert-libraries.c b/compiler-rt/test/tsan/Darwin/dyld-insert-libraries.c index 2e28a23c227bc..86f3f63a4af24 100644 --- a/compiler-rt/test/tsan/Darwin/dyld-insert-libraries.c +++ b/compiler-rt/test/tsan/Darwin/dyld-insert-libraries.c @@ -9,7 +9,7 @@ // // RUN: env DYLD_INSERT_LIBRARIES=%t.dylib %run %t 2>&1 | FileCheck %s --implicit-check-not='ThreadSanitizer' // -// XFAIL: ios +// XFAIL: darwin-remote #include #include diff --git a/compiler-rt/test/tsan/Darwin/write-interpose.c b/compiler-rt/test/tsan/Darwin/write-interpose.c index 51ff3ee3d0df9..feae0180a5276 100644 --- a/compiler-rt/test/tsan/Darwin/write-interpose.c +++ b/compiler-rt/test/tsan/Darwin/write-interpose.c @@ -8,7 +8,7 @@ // deadlock (self-lock) // RUN: env DYLD_INSERT_LIBRARIES=%t.dylib TSAN_OPTIONS=verbosity=2:lock_during_write=disable_for_current_process %run %t 2>&1 | FileCheck %s // -// UNSUPPORTED: ios +// UNSUPPORTED: darwin-remote #include diff --git a/compiler-rt/test/tsan/lit.site.cfg.py.in b/compiler-rt/test/tsan/lit.site.cfg.py.in index c6d453aaee26f..458da18a17147 100644 --- a/compiler-rt/test/tsan/lit.site.cfg.py.in +++ b/compiler-rt/test/tsan/lit.site.cfg.py.in @@ -5,6 +5,7 @@ config.tsan_lit_source_dir = "@TSAN_LIT_SOURCE_DIR@" config.has_libcxx = @TSAN_HAS_LIBCXX@ config.apple_platform = "@TSAN_TEST_APPLE_PLATFORM@" config.apple_platform_min_deployment_target_flag = "@TSAN_TEST_MIN_DEPLOYMENT_TARGET_FLAG@" +config.apple_target_is_host = @TSAN_TEST_APPLE_TARGET_IS_HOST_PYBOOL@ config.target_cflags = "@TSAN_TEST_TARGET_CFLAGS@" config.target_arch = "@TSAN_TEST_TARGET_ARCH@" config.deflake_threshold = "@TSAN_TEST_DEFLAKE_THRESHOLD@" diff --git a/compiler-rt/test/ubsan/CMakeLists.txt b/compiler-rt/test/ubsan/CMakeLists.txt index 410585e6a07ef..666577df98da3 100644 --- a/compiler-rt/test/ubsan/CMakeLists.txt +++ b/compiler-rt/test/ubsan/CMakeLists.txt @@ -44,7 +44,9 @@ foreach(arch ${UBSAN_TEST_ARCH}) if (APPLE) set(UBSAN_TEST_APPLE_PLATFORM "osx") set(UBSAN_TEST_MIN_DEPLOYMENT_TARGET_FLAG "${DARWIN_osx_MIN_VER_FLAG}") + set(UBSAN_TEST_APPLE_TARGET_IS_HOST ON) endif() + pythonize_bool(UBSAN_TEST_APPLE_TARGET_IS_HOST) get_test_cc_for_arch(${arch} UBSAN_TEST_TARGET_CC UBSAN_TEST_TARGET_CFLAGS) add_ubsan_testsuites("Standalone" ubsan ${arch}) @@ -74,10 +76,12 @@ macro(add_ubsan_device_testsuite test_mode sanitizer platform arch) if (APPLE) set(UBSAN_TEST_APPLE_PLATFORM "${platform}") set(UBSAN_TEST_MIN_DEPLOYMENT_TARGET_FLAG "${DARWIN_${platform}_MIN_VER_FLAG}") + set(UBSAN_TEST_APPLE_TARGET_IS_HOST OFF) else() unset(UBSAN_TEST_APPLE_PLATFORM) unset(UBSAN_TEST_MIN_DEPLOYMENT_TARGET_FLAG) endif() + pythonize_bool(UBSAN_TEST_APPLE_TARGET_IS_HOST) configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py) diff --git a/compiler-rt/test/ubsan/lit.site.cfg.py.in b/compiler-rt/test/ubsan/lit.site.cfg.py.in index 4dfd5c5b5c1a9..b5468b195be11 100644 --- a/compiler-rt/test/ubsan/lit.site.cfg.py.in +++ b/compiler-rt/test/ubsan/lit.site.cfg.py.in @@ -9,6 +9,7 @@ config.use_lld = @UBSAN_TEST_USE_LLD@ config.use_thinlto = @UBSAN_TEST_USE_THINLTO@ config.apple_platform = "@UBSAN_TEST_APPLE_PLATFORM@" config.apple_platform_min_deployment_target_flag = "@UBSAN_TEST_MIN_DEPLOYMENT_TARGET_FLAG@" +config.apple_target_is_host = @UBSAN_TEST_APPLE_TARGET_IS_HOST_PYBOOL@ # Load common config for all compiler-rt lit tests. lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")