1 // RUN: %clangxx_tsan %s -o %t -framework Foundation -std=c++11
2 // RUN: %run %t 2>&1 | FileCheck %s
4 #import <Foundation/Foundation.h>
5 #import <libkern/OSAtomic.h>
9 volatile int64_t retainCount = 0;
18 if (OSAtomicAdd64Barrier(-1, &retainCount) == 0) {
24 OSAtomicAdd64Barrier(1, &retainCount);
27 int main(int argc, const char * argv[]) {
28 fprintf(stderr, "start\n");
41 fprintf(stderr, "end, g = %ld\n", g);
48 // CHECK-NOT: WARNING: ThreadSanitizer