Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions compiler-rt/test/asan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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}")
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdlib.h>
#include <string.h>
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdlib.h>
#include <string.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -16,6 +14,7 @@
// RUN: FileCheck %s -input-file=%t.process_syslog_output.txt
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <sanitizer/asan_interface.h>

Expand Down
Original file line number Diff line number Diff line change
@@ -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 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions compiler-rt/test/asan/TestCases/Darwin/uuid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdio.h>
#include <stdlib.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <dlfcn.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/asan/TestCases/Posix/coverage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//
// https://code.google.com/p/address-sanitizer/issues/detail?id=263
// XFAIL: android
// UNSUPPORTED: ios
// UNSUPPORTED: darwin-remote

#include <assert.h>
#include <stdio.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// XFAIL: target=arm{{.*}}

// UNSUPPORTED: ios
// UNSUPPORTED: darwin-remote

#include <new>
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/asan/TestCases/default_ignorelist.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/asan/TestCases/log-path_test.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

// FIXME: Upload suppressions to device.
// XFAIL: android
// UNSUPPORTED: ios
// UNSUPPORTED: darwin-remote

#include <stdio.h>
#include <stdlib.h>
Expand Down
1 change: 1 addition & 0 deletions compiler-rt/test/asan/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@"

Expand Down
4 changes: 4 additions & 0 deletions compiler-rt/test/asan_abi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions compiler-rt/test/asan_abi/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions compiler-rt/test/fuzzer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/fuzzer/afl-driver-stderr.test
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/fuzzer/big-file-copy.test
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/fuzzer/cross_over.test
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
1 change: 1 addition & 0 deletions compiler-rt/test/fuzzer/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@"

Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/fuzzer/merge-control-file.test
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/fuzzer/merge-posix.test
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/fuzzer/seed_inputs.test
Original file line number Diff line number Diff line change
@@ -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

Expand Down
25 changes: 16 additions & 9 deletions compiler-rt/test/lit.common.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,26 +413,33 @@ 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.
#
# =========================================================================
# 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")
Expand Down
3 changes: 2 additions & 1 deletion compiler-rt/test/lit.common.configured.in
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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@)
Expand Down
Loading