1 // RUN: %clangxx_tsan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
8 void *Thread1(void *x
) {
14 void *Thread2(void *x
) {
15 pthread_setname_np(pthread_self(), "foobar2");
22 pthread_create(&t
[0], 0, Thread1
, 0);
23 pthread_create(&t
[1], 0, Thread2
, 0);
24 pthread_setname_np(t
[0], "foobar1");
25 pthread_join(t
[0], NULL
);
26 pthread_join(t
[1], NULL
);
29 // CHECK: WARNING: ThreadSanitizer: data race
30 // CHECK: Thread T1 'foobar1'
31 // CHECK: Thread T2 'foobar2'