]> git.proxmox.com Git - rustc.git/blame - src/compiler-rt/test/tsan/Darwin/gcd-async-norace.mm
New upstream version 1.12.0+dfsg1
[rustc.git] / src / compiler-rt / test / tsan / Darwin / gcd-async-norace.mm
CommitLineData
3157f602 1// RUN: %clang_tsan %s -o %t -framework Foundation
5bcae85e 2// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s
3157f602
XL
3
4#import <Foundation/Foundation.h>
5
6long global;
7
8int main() {
9 NSLog(@"Hello world.");
10
11 global = 42;
12 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
13 global = 43;
14
15 dispatch_sync(dispatch_get_main_queue(), ^{
16 CFRunLoopStop(CFRunLoopGetCurrent());
17 });
18 });
19
20 CFRunLoopRun();
21 NSLog(@"Done.");
22}
23
24// CHECK: Hello world.
25// CHECK: Done.
26// CHECK-NOT: WARNING: ThreadSanitizer