Index: test/sanitizer_common/ios_commands/iossim_run.py =================================================================== --- test/sanitizer_common/ios_commands/iossim_run.py +++ test/sanitizer_common/ios_commands/iossim_run.py @@ -1,6 +1,6 @@ #!/usr/bin/python -import os, sys, subprocess +import glob, os, sys, subprocess if not "SANITIZER_IOSSIM_TEST_DEVICE_IDENTIFIER" in os.environ: @@ -12,7 +12,29 @@ if e in os.environ: os.environ["SIMCTL_CHILD_" + e] = os.environ[e] -exitcode = subprocess.call(["xcrun", "simctl", "spawn", device_id] + sys.argv[1:]) +prog = sys.argv[1] +exit_code = None +if prog == 'rm': + # The simulator and host actually share the same file system so we can just + # execute directly on the host. + rm_args = sys.argv[2:] + rm_args_expanded = [] + for arg in rm_args: + # We might get glob patterns that are intended to be resolved on the device. + # Here we can just resolve them on the host. + if '*' in arg or '?' in arg: + matches = glob.glob(arg) + if len(matches) > 0: + rm_args_expanded.extend(matches) + else: + # Just pass through unexpanded if we can't find a match. + rm_args_expanded.append(arg) + else: + rm_args_expanded.append(arg) + rm_cmd_line = ["/bin/rm"] + rm_args_expanded + exitcode = subprocess.call(rm_cmd_line) +else: + exitcode = subprocess.call(["xcrun", "simctl", "spawn", device_id] + sys.argv[1:]) if exitcode > 125: exitcode = 126 sys.exit(exitcode) Index: test/ubsan/TestCases/Misc/log-path_test.cc =================================================================== --- test/ubsan/TestCases/Misc/log-path_test.cc +++ test/ubsan/TestCases/Misc/log-path_test.cc @@ -12,11 +12,13 @@ // Good log_path. // RUN: rm -f %t.log.* +// RUN: %run rm -f '%t.log.*' // RUN: %env_ubsan_opts=log_path='"%t.log"' %run %t -4 2> %t.out // RUN: FileCheck %s --check-prefix=CHECK-ERROR < %t.log.* // Run w/o errors should not produce any log. // RUN: rm -f %t.log.* +// RUN: %run rm -f '%t.log.*' // RUN: %env_ubsan_opts=log_path='"%t.log"' %run %t 4 // RUN: not cat %t.log.*