aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/asan/TestCases/Darwin/address-range-limit.mm3
-rw-r--r--test/asan/TestCases/Darwin/atos-symbolizer-dyld-root-path.cc3
-rw-r--r--test/asan/TestCases/Darwin/atos-symbolizer.cc3
-rw-r--r--test/asan/TestCases/Darwin/dladdr-demangling.cc3
-rw-r--r--test/asan/TestCases/Darwin/dyld_insert_libraries_reexec.cc2
-rw-r--r--test/asan/TestCases/Darwin/dyld_insert_libraries_remove.cc2
-rw-r--r--test/asan/TestCases/Darwin/haswell-symbolication.cc1
-rw-r--r--test/asan/TestCases/Darwin/interface_symbols_darwin.c2
-rw-r--r--test/asan/TestCases/Darwin/sandbox-symbolizer.cc3
-rw-r--r--test/asan/TestCases/Darwin/suppressions-sandbox.cc3
-rw-r--r--test/asan/TestCases/Darwin/uuid.cc3
-rw-r--r--test/asan/TestCases/Posix/closed-fds.cc1
-rw-r--r--test/asan/TestCases/Posix/coverage-maybe-open-file.cc1
-rw-r--r--test/asan/TestCases/Posix/coverage-module-unloaded.cc1
-rw-r--r--test/asan/TestCases/Posix/coverage-sandboxing.cc1
-rw-r--r--test/asan/TestCases/Posix/coverage.cc1
-rw-r--r--test/asan/TestCases/Posix/glob.cc1
-rw-r--r--test/asan/TestCases/Posix/start-deactivated.cc1
-rw-r--r--test/asan/TestCases/Windows/coverage-dll-stdio.cc4
-rw-r--r--test/asan/TestCases/default_blacklist.cc1
-rw-r--r--test/asan/TestCases/log-path_test.cc1
-rw-r--r--test/asan/TestCases/suppressions-exec-relative-location.cc1
-rw-r--r--test/asan/TestCases/suppressions-function.cc1
-rw-r--r--test/asan/TestCases/verbose-log-path_test.cc1
-rw-r--r--test/sanitizer_common/TestCases/Linux/mprobe.cc42
-rw-r--r--test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cc12
-rw-r--r--test/tsan/Darwin/external-dups.cc4
-rw-r--r--test/tsan/Darwin/external-swift.cc92
-rw-r--r--test/tsan/Darwin/external.cc14
29 files changed, 198 insertions, 10 deletions
diff --git a/test/asan/TestCases/Darwin/address-range-limit.mm b/test/asan/TestCases/Darwin/address-range-limit.mm
index ba9175a2ce20..5f0fd89f8899 100644
--- a/test/asan/TestCases/Darwin/address-range-limit.mm
+++ b/test/asan/TestCases/Darwin/address-range-limit.mm
@@ -3,6 +3,9 @@
// RUN: %clangxx_asan %s -Wno-deprecated-declarations -flat_namespace -bundle -undefined suppress -o %t.bundle
// RUN: %clangxx_asan %s -Wno-deprecated-declarations -o %t -framework Foundation && not %run %t 2>&1 | FileCheck %s
+// NSCreateObjectFileImageFromFile/NSLinkModule isn't available on iOS
+// UNSUPPORTED: ios
+
#import <Foundation/Foundation.h>
#import <mach-o/dyld.h>
diff --git a/test/asan/TestCases/Darwin/atos-symbolizer-dyld-root-path.cc b/test/asan/TestCases/Darwin/atos-symbolizer-dyld-root-path.cc
index d2facd6d0c2e..fc3d0dd0b40d 100644
--- a/test/asan/TestCases/Darwin/atos-symbolizer-dyld-root-path.cc
+++ b/test/asan/TestCases/Darwin/atos-symbolizer-dyld-root-path.cc
@@ -6,6 +6,9 @@
// 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
+
#include <stdlib.h>
#include <string.h>
int main(int argc, char **argv) {
diff --git a/test/asan/TestCases/Darwin/atos-symbolizer.cc b/test/asan/TestCases/Darwin/atos-symbolizer.cc
index b4a868e242ea..7b091c4d681c 100644
--- a/test/asan/TestCases/Darwin/atos-symbolizer.cc
+++ b/test/asan/TestCases/Darwin/atos-symbolizer.cc
@@ -3,6 +3,9 @@
// 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
+
#include <stdlib.h>
#include <string.h>
int main(int argc, char **argv) {
diff --git a/test/asan/TestCases/Darwin/dladdr-demangling.cc b/test/asan/TestCases/Darwin/dladdr-demangling.cc
index 6f52b93da04b..fb6f6d79b5f4 100644
--- a/test/asan/TestCases/Darwin/dladdr-demangling.cc
+++ b/test/asan/TestCases/Darwin/dladdr-demangling.cc
@@ -5,6 +5,9 @@
// RUN: not %run %t 2>&1 | FileCheck %s
// RUN: %env_asan_opts=verbosity=2 not %run sandbox-exec -p '(version 1)(allow default)(deny process-fork)' %t 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-DLADDR
+// sandbox-exec isn't available on iOS
+// UNSUPPORTED: ios
+
#include <stdlib.h>
class MyClass {
diff --git a/test/asan/TestCases/Darwin/dyld_insert_libraries_reexec.cc b/test/asan/TestCases/Darwin/dyld_insert_libraries_reexec.cc
index b22036a7efed..5c975b8dad2b 100644
--- a/test/asan/TestCases/Darwin/dyld_insert_libraries_reexec.cc
+++ b/test/asan/TestCases/Darwin/dyld_insert_libraries_reexec.cc
@@ -1,6 +1,8 @@
// When DYLD-inserting the ASan dylib from a different location than the
// original, make sure we don't try to reexec.
+// UNSUPPORTED: ios
+
// RUN: mkdir -p %T/dyld_insert_libraries_reexec
// RUN: cp `%clang_asan %s -fsanitize=address -### 2>&1 \
// RUN: | grep "libclang_rt.asan_osx_dynamic.dylib" \
diff --git a/test/asan/TestCases/Darwin/dyld_insert_libraries_remove.cc b/test/asan/TestCases/Darwin/dyld_insert_libraries_remove.cc
index a3af8c156ef2..69d849793d7a 100644
--- a/test/asan/TestCases/Darwin/dyld_insert_libraries_remove.cc
+++ b/test/asan/TestCases/Darwin/dyld_insert_libraries_remove.cc
@@ -2,6 +2,8 @@
// 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
+
// RUN: mkdir -p %T/dyld_insert_libraries_remove
// RUN: cp `%clang_asan %s -fsanitize=address -### 2>&1 \
// RUN: | grep "libclang_rt.asan_osx_dynamic.dylib" \
diff --git a/test/asan/TestCases/Darwin/haswell-symbolication.cc b/test/asan/TestCases/Darwin/haswell-symbolication.cc
index 59c938ca5087..7856c4d61e16 100644
--- a/test/asan/TestCases/Darwin/haswell-symbolication.cc
+++ b/test/asan/TestCases/Darwin/haswell-symbolication.cc
@@ -48,6 +48,7 @@
// REQUIRES: x86-target-arch
// REQUIRES: x86_64h
+// UNSUPPORTED: ios
#include <sanitizer/common_interface_defs.h>
#include <stdio.h>
diff --git a/test/asan/TestCases/Darwin/interface_symbols_darwin.c b/test/asan/TestCases/Darwin/interface_symbols_darwin.c
index 9450575b4ecd..09af1ece589f 100644
--- a/test/asan/TestCases/Darwin/interface_symbols_darwin.c
+++ b/test/asan/TestCases/Darwin/interface_symbols_darwin.c
@@ -31,4 +31,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
+
int main() { return 0; }
diff --git a/test/asan/TestCases/Darwin/sandbox-symbolizer.cc b/test/asan/TestCases/Darwin/sandbox-symbolizer.cc
index 4310f9c599e3..b36c4faedd55 100644
--- a/test/asan/TestCases/Darwin/sandbox-symbolizer.cc
+++ b/test/asan/TestCases/Darwin/sandbox-symbolizer.cc
@@ -12,6 +12,9 @@
// RUN: not %run sandbox-exec -p '(version 1)(allow default)(deny mach-priv-task-port)' %t 2>&1 | FileCheck %s
// RUN: env ASAN_SYMBOLIZER_PATH="" not %run sandbox-exec -p '(version 1)(allow default)(deny mach-priv-task-port)' %t 2>&1 | FileCheck %s
+// sandbox-exec isn't available on iOS
+// UNSUPPORTED: ios
+
#include <stdlib.h>
int main() {
char *x = (char*)malloc(10 * sizeof(char));
diff --git a/test/asan/TestCases/Darwin/suppressions-sandbox.cc b/test/asan/TestCases/Darwin/suppressions-sandbox.cc
index c0b84addaa81..966f21346e4f 100644
--- a/test/asan/TestCases/Darwin/suppressions-sandbox.cc
+++ b/test/asan/TestCases/Darwin/suppressions-sandbox.cc
@@ -8,6 +8,9 @@
// RUN: sandbox-exec -p '(version 1)(allow default)(deny process-fork)' \
// RUN: %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
+// sandbox-exec isn't available on iOS
+// UNSUPPORTED: ios
+
#include <CoreFoundation/CoreFoundation.h>
int main() {
diff --git a/test/asan/TestCases/Darwin/uuid.cc b/test/asan/TestCases/Darwin/uuid.cc
index 3f50272e901d..33638587e129 100644
--- a/test/asan/TestCases/Darwin/uuid.cc
+++ b/test/asan/TestCases/Darwin/uuid.cc
@@ -4,6 +4,9 @@
// 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
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/test/asan/TestCases/Posix/closed-fds.cc b/test/asan/TestCases/Posix/closed-fds.cc
index 75e3216aab5a..b2604bba58ba 100644
--- a/test/asan/TestCases/Posix/closed-fds.cc
+++ b/test/asan/TestCases/Posix/closed-fds.cc
@@ -8,6 +8,7 @@
// FIXME: copy %t.log back from the device and re-enable on Android.
// UNSUPPORTED: android
+// UNSUPPORTED: ios
#include <assert.h>
#include <stdio.h>
diff --git a/test/asan/TestCases/Posix/coverage-maybe-open-file.cc b/test/asan/TestCases/Posix/coverage-maybe-open-file.cc
index 95f2b5449e83..ee2977af11c4 100644
--- a/test/asan/TestCases/Posix/coverage-maybe-open-file.cc
+++ b/test/asan/TestCases/Posix/coverage-maybe-open-file.cc
@@ -1,5 +1,6 @@
// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316
// XFAIL: android
+// UNSUPPORTED: ios
//
// RUN: %clangxx_asan -fsanitize-coverage=func %s -o %t
// RUN: rm -rf %T/coverage-maybe-open-file
diff --git a/test/asan/TestCases/Posix/coverage-module-unloaded.cc b/test/asan/TestCases/Posix/coverage-module-unloaded.cc
index d492af6662fa..db27283a62c6 100644
--- a/test/asan/TestCases/Posix/coverage-module-unloaded.cc
+++ b/test/asan/TestCases/Posix/coverage-module-unloaded.cc
@@ -10,6 +10,7 @@
//
// https://code.google.com/p/address-sanitizer/issues/detail?id=263
// XFAIL: android
+// UNSUPPORTED: ios
#include <assert.h>
#include <dlfcn.h>
diff --git a/test/asan/TestCases/Posix/coverage-sandboxing.cc b/test/asan/TestCases/Posix/coverage-sandboxing.cc
index 431dce149525..354070708a7d 100644
--- a/test/asan/TestCases/Posix/coverage-sandboxing.cc
+++ b/test/asan/TestCases/Posix/coverage-sandboxing.cc
@@ -21,6 +21,7 @@
// https://code.google.com/p/address-sanitizer/issues/detail?id=263
// XFAIL: android
+// UNSUPPORTED: ios
#include <assert.h>
#include <fcntl.h>
diff --git a/test/asan/TestCases/Posix/coverage.cc b/test/asan/TestCases/Posix/coverage.cc
index 3d1dccfbd549..bff060968483 100644
--- a/test/asan/TestCases/Posix/coverage.cc
+++ b/test/asan/TestCases/Posix/coverage.cc
@@ -18,6 +18,7 @@
//
// https://code.google.com/p/address-sanitizer/issues/detail?id=263
// XFAIL: android
+// UNSUPPORTED: ios
#include <sanitizer/coverage_interface.h>
#include <assert.h>
diff --git a/test/asan/TestCases/Posix/glob.cc b/test/asan/TestCases/Posix/glob.cc
index e0eeb33cca24..46d4a0d8d43d 100644
--- a/test/asan/TestCases/Posix/glob.cc
+++ b/test/asan/TestCases/Posix/glob.cc
@@ -1,5 +1,6 @@
// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316
// XFAIL: android
+// UNSUPPORTED: ios
//
// RUN: %clangxx_asan -O0 %s -o %t && %run %t %p 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 %s -o %t && %run %t %p 2>&1 | FileCheck %s
diff --git a/test/asan/TestCases/Posix/start-deactivated.cc b/test/asan/TestCases/Posix/start-deactivated.cc
index 2a2aa674c04c..2870ffb2f454 100644
--- a/test/asan/TestCases/Posix/start-deactivated.cc
+++ b/test/asan/TestCases/Posix/start-deactivated.cc
@@ -19,6 +19,7 @@
// RUN: ASAN_ACTIVATION_OPTIONS=help=1,handle_segv=0,verbosity=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-UNSUPPORTED
// XFAIL: arm-linux-gnueabi
+// UNSUPPORTED: ios
// END.
diff --git a/test/asan/TestCases/Windows/coverage-dll-stdio.cc b/test/asan/TestCases/Windows/coverage-dll-stdio.cc
index 5e12e3855449..92cd0a7bc043 100644
--- a/test/asan/TestCases/Windows/coverage-dll-stdio.cc
+++ b/test/asan/TestCases/Windows/coverage-dll-stdio.cc
@@ -2,8 +2,8 @@
// __local_stdio_printf_options function isn't instrumented for coverage.
// RUN: rm -rf %t && mkdir %t && cd %t
-// RUN: %clang_cl_asan -fsanitize-coverage=func -O0 %p/dll_host.cc -Fet.exe
-// RUN: %clang_cl_asan -fsanitize-coverage=func -LD -O0 %s -Fet.dll
+// RUN: %clang_cl_asan -fsanitize-coverage=func,trace-pc-guard -O0 %p/dll_host.cc -Fet.exe
+// RUN: %clang_cl_asan -fsanitize-coverage=func,trace-pc-guard -LD -O0 %s -Fet.dll
// RUN: %run ./t.exe t.dll 2>&1 | FileCheck %s
#include <stdio.h>
diff --git a/test/asan/TestCases/default_blacklist.cc b/test/asan/TestCases/default_blacklist.cc
index 9358cc47cbaa..84c0438f3058 100644
--- a/test/asan/TestCases/default_blacklist.cc
+++ b/test/asan/TestCases/default_blacklist.cc
@@ -1,5 +1,6 @@
// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316
// XFAIL: android
+// UNSUPPORTED: ios
//
// Test that ASan uses the default blacklist from resource directory.
// RUN: %clangxx_asan -### %s 2>&1 | FileCheck %s
diff --git a/test/asan/TestCases/log-path_test.cc b/test/asan/TestCases/log-path_test.cc
index b4218ad85230..710d22017700 100644
--- a/test/asan/TestCases/log-path_test.cc
+++ b/test/asan/TestCases/log-path_test.cc
@@ -1,5 +1,6 @@
// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316
// XFAIL: android
+// UNSUPPORTED: ios
//
// The for loop in the backticks below requires bash.
// REQUIRES: shell
diff --git a/test/asan/TestCases/suppressions-exec-relative-location.cc b/test/asan/TestCases/suppressions-exec-relative-location.cc
index 740cecee15c0..d4e214d35a0e 100644
--- a/test/asan/TestCases/suppressions-exec-relative-location.cc
+++ b/test/asan/TestCases/suppressions-exec-relative-location.cc
@@ -25,6 +25,7 @@
// XFAIL: android
// XFAIL: win32
+// UNSUPPORTED: ios
#include <stdio.h>
#include <stdlib.h>
diff --git a/test/asan/TestCases/suppressions-function.cc b/test/asan/TestCases/suppressions-function.cc
index d5ac9f7792ba..c7f1ebe66968 100644
--- a/test/asan/TestCases/suppressions-function.cc
+++ b/test/asan/TestCases/suppressions-function.cc
@@ -8,6 +8,7 @@
// FIXME: Windows symbolizer needs work to make this pass.
// XFAIL: android,win32
+// UNSUPPORTED: ios
#include <stdio.h>
#include <stdlib.h>
diff --git a/test/asan/TestCases/verbose-log-path_test.cc b/test/asan/TestCases/verbose-log-path_test.cc
index 47a5c226a1bf..a63c58475242 100644
--- a/test/asan/TestCases/verbose-log-path_test.cc
+++ b/test/asan/TestCases/verbose-log-path_test.cc
@@ -10,6 +10,7 @@
// FIXME: only FreeBSD and Linux have verbose log paths now.
// XFAIL: win32,android
+// UNSUPPORTED: ios
#include <stdlib.h>
#include <string.h>
diff --git a/test/sanitizer_common/TestCases/Linux/mprobe.cc b/test/sanitizer_common/TestCases/Linux/mprobe.cc
new file mode 100644
index 000000000000..57e5ba5a6c74
--- /dev/null
+++ b/test/sanitizer_common/TestCases/Linux/mprobe.cc
@@ -0,0 +1,42 @@
+// RUN: %clangxx %s -o %t && %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: android
+
+#include <stdio.h>
+#include <stdlib.h>
+#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 2)
+#include <mcheck.h>
+#else
+#define MCHECK_OK 0
+extern "C" int mcheck(void (*abortfunc)(int mstatus));
+extern "C" int mcheck_pedantic(void (*abortfunc)(int mstatus));
+extern "C" int mprobe(void *ptr);
+#endif
+
+void check_heap() {
+ void *p = malloc(1000);
+ int res = mprobe(p);
+ if (res == MCHECK_OK)
+ printf("Success!\n");
+ free(p);
+}
+
+int main(int argc, char *argv[]) {
+ void *p;
+ if (mcheck(NULL) != 0) {
+ fprintf(stderr, "mcheck() failed\n");
+ exit(EXIT_FAILURE);
+ }
+
+ check_heap();
+ // CHECK: Success!
+
+ if (mcheck_pedantic(NULL) != 0) {
+ fprintf(stderr, "mcheck_pedantic() failed\n");
+ exit(EXIT_FAILURE);
+ }
+
+ check_heap();
+ // CHECK: Success!
+
+ return 0;
+}
diff --git a/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cc b/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cc
new file mode 100644
index 000000000000..f48cce8ea22b
--- /dev/null
+++ b/test/sanitizer_common/TestCases/Linux/unexpected_format_specifier_test.cc
@@ -0,0 +1,12 @@
+// RUN: %clang -w -O0 %s -o %t && %run %t 2>&1 | FileCheck %s
+// UNSUPPORTED: lsan
+// UNSUPPORTED: msan
+#include <stdio.h>
+int main() {
+ int a;
+ printf("%Q\n", 1);
+ printf("%Q\n", 1);
+ printf("%Q\n", 1);
+}
+// CHECK: unexpected format specifier in printf interceptor: %Q (reported once per process)
+// CHECK-NOT: unexpected format specifier in printf interceptor
diff --git a/test/tsan/Darwin/external-dups.cc b/test/tsan/Darwin/external-dups.cc
index 79432bac4a02..ca1eb3e7cc43 100644
--- a/test/tsan/Darwin/external-dups.cc
+++ b/test/tsan/Darwin/external-dups.cc
@@ -28,7 +28,7 @@ int main(int argc, char *argv[]) {
barrier_wait(&barrier);
ExternalWrite(opaque_object);
});
- // CHECK: WARNING: ThreadSanitizer: race on a library object
+ // CHECK: WARNING: ThreadSanitizer: race on HelloWorld
t1.join();
t2.join();
}
@@ -46,7 +46,7 @@ int main(int argc, char *argv[]) {
barrier_wait(&barrier);
ExternalWrite(opaque_object);
});
- // CHECK: WARNING: ThreadSanitizer: race on a library object
+ // CHECK: WARNING: ThreadSanitizer: race on HelloWorld
t1.join();
t2.join();
}
diff --git a/test/tsan/Darwin/external-swift.cc b/test/tsan/Darwin/external-swift.cc
new file mode 100644
index 000000000000..f6f9e7f4ece3
--- /dev/null
+++ b/test/tsan/Darwin/external-swift.cc
@@ -0,0 +1,92 @@
+// RUN: %clangxx_tsan %s -o %t
+// RUN: %deflake %run %t 2>&1 | FileCheck %s
+
+#include <thread>
+
+#import "../test.h"
+
+extern "C" {
+void __tsan_write8(void *addr);
+}
+
+static void *tag = (void *)0x1;
+
+__attribute__((no_sanitize("thread")))
+void ExternalWrite(void *addr) {
+ __tsan_external_write(addr, nullptr, tag);
+}
+
+__attribute__((no_sanitize("thread")))
+void RegularWrite(void *addr) {
+ __tsan_write8(addr);
+}
+
+int main(int argc, char *argv[]) {
+ barrier_init(&barrier, 2);
+ fprintf(stderr, "Start.\n");
+ // CHECK: Start.
+
+ {
+ void *opaque_object = malloc(16);
+ std::thread t1([opaque_object] {
+ ExternalWrite(opaque_object);
+ barrier_wait(&barrier);
+ });
+ std::thread t2([opaque_object] {
+ barrier_wait(&barrier);
+ ExternalWrite(opaque_object);
+ });
+ // CHECK: WARNING: ThreadSanitizer: Swift access race
+ // CHECK: Modifying access of Swift variable at {{.*}} by thread {{.*}}
+ // CHECK: Previous modifying access of Swift variable at {{.*}} by thread {{.*}}
+ // CHECK: SUMMARY: ThreadSanitizer: Swift access race
+ t1.join();
+ t2.join();
+ }
+
+ fprintf(stderr, "external+external test done.\n");
+ // CHECK: external+external test done.
+
+ {
+ void *opaque_object = malloc(16);
+ std::thread t1([opaque_object] {
+ ExternalWrite(opaque_object);
+ barrier_wait(&barrier);
+ });
+ std::thread t2([opaque_object] {
+ barrier_wait(&barrier);
+ RegularWrite(opaque_object);
+ });
+ // CHECK: WARNING: ThreadSanitizer: Swift access race
+ // CHECK: Write of size 8 at {{.*}} by thread {{.*}}
+ // CHECK: Previous modifying access of Swift variable at {{.*}} by thread {{.*}}
+ // CHECK: SUMMARY: ThreadSanitizer: Swift access race
+ t1.join();
+ t2.join();
+ }
+
+ fprintf(stderr, "external+regular test done.\n");
+ // CHECK: external+regular test done.
+
+ {
+ void *opaque_object = malloc(16);
+ std::thread t1([opaque_object] {
+ RegularWrite(opaque_object);
+ barrier_wait(&barrier);
+ });
+ std::thread t2([opaque_object] {
+ barrier_wait(&barrier);
+ ExternalWrite(opaque_object);
+ });
+ // CHECK: WARNING: ThreadSanitizer: Swift access race
+ // CHECK: Modifying access of Swift variable at {{.*}} by thread {{.*}}
+ // CHECK: Previous write of size 8 at {{.*}} by thread {{.*}}
+ // CHECK: SUMMARY: ThreadSanitizer: Swift access race
+ t1.join();
+ t2.join();
+ }
+
+ fprintf(stderr, "regular+external test done.\n");
+ // CHECK: regular+external test done.
+}
+
diff --git a/test/tsan/Darwin/external.cc b/test/tsan/Darwin/external.cc
index 211694ab7db1..e72281afa488 100644
--- a/test/tsan/Darwin/external.cc
+++ b/test/tsan/Darwin/external.cc
@@ -67,13 +67,14 @@ int main(int argc, char *argv[]) {
// TEST2-NOT: WARNING: ThreadSanitizer
- // TEST3: WARNING: ThreadSanitizer: race on a library object
- // TEST3: {{Mutating|read-only}} access of MyLibrary::MyObject at
+ // TEST3: WARNING: ThreadSanitizer: race on MyLibrary::MyObject
+ // TEST3: {{Modifying|read-only}} access of MyLibrary::MyObject at
// TEST3: {{ObjectWrite|ObjectRead}}
- // TEST3: Previous {{mutating|read-only}} access of MyLibrary::MyObject at
+ // TEST3: Previous {{modifying|read-only}} access of MyLibrary::MyObject at
// TEST3: {{ObjectWrite|ObjectRead}}
// TEST3: Location is MyLibrary::MyObject of size 16 at
// TEST3: {{ObjectCreate}}
+ // TEST3: SUMMARY: ThreadSanitizer: race on MyLibrary::MyObject {{.*}} in {{ObjectWrite|ObjectRead}}
fprintf(stderr, "RW test done\n");
// CHECK: RW test done
@@ -90,13 +91,14 @@ int main(int argc, char *argv[]) {
// TEST2-NOT: WARNING: ThreadSanitizer
- // TEST3: WARNING: ThreadSanitizer: race on a library object
- // TEST3: Mutating access of MyLibrary::MyObject at
+ // TEST3: WARNING: ThreadSanitizer: race on MyLibrary::MyObject
+ // TEST3: Modifying access of MyLibrary::MyObject at
// TEST3: {{ObjectWrite|ObjectWriteAnother}}
- // TEST3: Previous mutating access of MyLibrary::MyObject at
+ // TEST3: Previous modifying access of MyLibrary::MyObject at
// TEST3: {{ObjectWrite|ObjectWriteAnother}}
// TEST3: Location is MyLibrary::MyObject of size 16 at
// TEST3: {{ObjectCreate}}
+ // TEST3: SUMMARY: ThreadSanitizer: race on MyLibrary::MyObject {{.*}} in {{ObjectWrite|ObjectWriteAnother}}
fprintf(stderr, "WW test done\n");
// CHECK: WW test done