summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJulian Lettner <jlettner@apple.com>2019-01-07 19:19:23 +0000
committerJulian Lettner <jlettner@apple.com>2019-01-07 19:19:23 +0000
commit8ebc3668b07fc5cca6010265cd4795443f1c1bea (patch)
tree82b67ed234d2ed1dc64cca5d66d897d4a25c7474 /test
parent79d27782ac7006e5b2878e7366749769ed6a11f4 (diff)
downloadcompiler-rt-8ebc3668b07fc5cca6010265cd4795443f1c1bea.tar.gz
[TSan] Support Objective-C @synchronized with tagged pointers
Summary: Objective-C employs tagged pointers, that is, small objects/values may be encoded directly in the pointer bits. The resulting pointer is not backed by an allocation/does not point to a valid memory. TSan infrastructure requires a valid address for `Acquire/Release` and `Mutex{Lock/Unlock}`. This patch establishes such a mapping via a "dummy allocation" for each encountered tagged pointer value. Reviewers: dcoughlin, kubamracek, dvyukov, delcypher Reviewed By: dvyukov Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D56238 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350556 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/tsan/Darwin/objc-synchronize-cycle-tagged.mm3
1 files changed, 1 insertions, 2 deletions
diff --git a/test/tsan/Darwin/objc-synchronize-cycle-tagged.mm b/test/tsan/Darwin/objc-synchronize-cycle-tagged.mm
index a0c132661..5806e8af9 100644
--- a/test/tsan/Darwin/objc-synchronize-cycle-tagged.mm
+++ b/test/tsan/Darwin/objc-synchronize-cycle-tagged.mm
@@ -1,7 +1,6 @@
// RUN: %clangxx_tsan %s -o %t -framework Foundation -fobjc-arc %darwin_min_target_with_full_runtime_arc_support
// RUN: %run %t 6 2>&1 | FileCheck %s --check-prefix=SIX
// RUN: not %run %t 7 2>&1 | FileCheck %s --check-prefix=SEVEN
-// XFAIL: *
#import <Foundation/Foundation.h>
@@ -12,7 +11,7 @@ static bool isTaggedPtr(id obj) {
int main(int argc, char* argv[]) {
assert(argc == 2);
- int arg = atoi(argv[0]);
+ int arg = atoi(argv[1]);
@autoreleasepool {
NSObject* obj = [NSObject new];