]>
git.proxmox.com Git - rustc.git/blob - src/libcompiler_builtins/compiler-rt/test/tsan/Linux/double_race.cc
1 // RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t 2>&1 | FileCheck %s
5 // A reproducer for a known issue.
6 // See reference to double_race.cc in tsan_rtl_report.cc for an explanation.
11 void __sanitizer_report_error_summary(const char *summary
) {
15 const int kEventPCBits
= 61;
17 extern "C" bool __tsan_symbolize_external(unsigned long pc
, char *func_buf
,
18 unsigned long func_siz
,
20 unsigned long file_siz
, int *line
,
22 if (pc
>> kEventPCBits
) {
23 printf("bad PC passed to __tsan_symbolize_external: %lx\n", pc
);
29 void *Thread(void *arg
) {
30 barrier_wait(&barrier
);
31 memset(buf
, 2, sizeof(buf
));
36 barrier_init(&barrier
, 2);
38 pthread_create(&t
, 0, Thread
, 0);
39 memset(buf
, 1, sizeof(buf
));
40 barrier_wait(&barrier
);
45 // CHECK: WARNING: ThreadSanitizer: data race
46 // CHECK: Write of size 8 at {{.*}} by thread T1:
49 // CHECK-NOT: bad PC passed to __tsan_symbolize_external
50 // CHECK: WARNING: ThreadSanitizer: data race
51 // CHECK: Write of size 8 at {{.*}} by thread T1: