1 // RUN: %clangxx_tsan %s -o %t
2 // RUN: %run %t 2>&1 | FileCheck %s
8 int main(int argc, const char *argv[]) {
9 fprintf(stderr, "Hello world.\n");
11 auto my_task = [] { return 42; };
13 std::vector<std::thread> threads;
15 for (int i = 0; i < 100; i++) {
16 std::packaged_task<int(void)> task(my_task);
17 std::future<int> future = task.get_future();
18 threads.push_back(std::thread(std::move(task)));
21 for (auto &t : threads) {
25 fprintf(stderr, "Done.\n");
28 // CHECK: Hello world.
29 // CHECK-NOT: WARNING: ThreadSanitizer