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>
10 std::once_flag once_token;
13 std::call_once(once_token, [] {
18 fprintf(stderr, "my_global = %ld\n", val);
21 int main(int argc, const char *argv[]) {
22 fprintf(stderr, "Hello world.\n");
24 std::thread t1(thread_func);
25 std::thread t2(thread_func);
29 fprintf(stderr, "Done.\n");
32 // CHECK: Hello world.
33 // CHECK-NOT: WARNING: ThreadSanitizer