1 | // RUN: %clangxx_tsan %s -o %t |
2 | // RUN: %env_tsan_opts=verbosity=2:external_symbolizer_path= %deflake %run %t | FileCheck %s |
3 | #include "../test.h" |
4 | |
5 | int GlobalData[10]; |
6 | |
7 | void *Thread(void *a) { |
8 | barrier_wait(barrier: &barrier); |
9 | GlobalData[2] = 42; |
10 | return 0; |
11 | } |
12 | |
13 | int main() { |
14 | barrier_init(barrier: &barrier, count: 2); |
15 | print_address("addr=" , 1, GlobalData); |
16 | pthread_t t; |
17 | pthread_create(newthread: &t, attr: 0, start_routine: Thread, arg: 0); |
18 | GlobalData[2] = 43; |
19 | barrier_wait(barrier: &barrier); |
20 | pthread_join(th: t, thread_return: 0); |
21 | } |
22 | |
23 | // CHECK: External symbolizer is explicitly disabled. |
24 | // CHECK: Using dladdr symbolizer. |
25 | // CHECK: addr=[[ADDR:0x[0-9,a-f]+]] |
26 | // CHECK: WARNING: ThreadSanitizer: data race |
27 | // CHECK: Location is global 'GlobalData' at [[ADDR]] ({{.*}}+0x{{[0-9,a-f]+}}) |
28 | |