1 // RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
2 // This test fails on powerpc64 big endian.
3 // The Tsan report is returning wrong information about
4 // the location of the race.
5 // XFAIL: target=powerpc64-unknown-linux-gnu{{.*}}
9 typedef unsigned long uptr
;
10 extern "C" void __tsan_read_range_pc(uptr addr
, uptr size
, uptr pc
);
11 extern "C" void __tsan_write_range_pc(uptr addr
, uptr size
, uptr pc
);
19 void *Thread(void *p
) {
20 barrier_wait(&barrier
);
21 __tsan_read_range_pc((uptr
)p
, 32, (uptr
)foobar
+ kPCInc
);
26 barrier_init(&barrier
, 2);
29 pthread_create(&th
, 0, Thread
, (void*)a
);
30 __tsan_write_range_pc((uptr
)(a
+2), 32, (uptr
)barbaz
+ kPCInc
);
31 barrier_wait(&barrier
);
33 fprintf(stderr
, "DONE\n");
37 // CHECK: WARNING: ThreadSanitizer: data race