[PATCH] D139652: Add the thread sanitizer support for X86_64 WatchOS simulators

Yifan Yang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 8 10:22:45 PST 2022


yfyang created this revision.
yfyang added a reviewer: jyknight.
Herald added a subscriber: pengfei.
Herald added a project: All.
yfyang requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay.
Herald added a project: clang.

Thread sanitizer for x86_64 architecutre is supported currently for TVOS and iOS simulators.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139652

Files:
  clang/lib/Driver/ToolChains/Darwin.cpp
  clang/test/Driver/fsanitize.c


Index: clang/test/Driver/fsanitize.c
===================================================================
--- clang/test/Driver/fsanitize.c
+++ clang/test/Driver/fsanitize.c
@@ -463,6 +463,9 @@
 // RUN: %clang --target=x86_64-apple-ios-simulator -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-IOSSIMULATOR
 // CHECK-TSAN-X86-64-IOSSIMULATOR-NOT: unsupported option
 
+// RUN: %clang --target=x86_64-apple-watchos-simulator -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-WATCHOSSIMULATOR
+// CHECK-TSAN-X86-64-WATCHOSSIMULATOR-NOT: unsupported option
+
 // RUN: %clang --target=x86_64-apple-tvos-simulator -fsanitize=thread %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-TSAN-X86-64-TVOSSIMULATOR
 // CHECK-TSAN-X86-64-TVOSSIMULATOR-NOT: unsupported option
 
Index: clang/lib/Driver/ToolChains/Darwin.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Darwin.cpp
+++ clang/lib/Driver/ToolChains/Darwin.cpp
@@ -3279,7 +3279,8 @@
 
   if ((IsX86_64 || IsAArch64) && isTargetMacOSBased()) {
     Res |= SanitizerKind::Thread;
-  } else if (isTargetIOSSimulator() || isTargetTvOSSimulator()) {
+  } else if (isTargetIOSSimulator() || isTargetTvOSSimulator() ||
+             isTargetWatchOSSimulator()) {
     if (IsX86_64)
       Res |= SanitizerKind::Thread;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139652.481353.patch
Type: text/x-patch
Size: 1379 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221208/4bd64429/attachment.bin>


More information about the cfe-commits mailing list