[Sanitizer] Add rudimentary support for wide-character strings to scanf/printf interc...
[blocksruntime.git] / test / tsan / blacklist.cc
blob5baf926e6272bc80003d4b11c7c90a56b5054ef5
1 // Test blacklist functionality for TSan.
3 // RUN: %clangxx_tsan -O1 %s \
4 // RUN: -fsanitize-blacklist=%p/Helpers/blacklist.txt \
5 // RUN: -o %t && %t 2>&1 | FileCheck %s
6 #include <pthread.h>
7 #include <stdio.h>
9 int Global;
11 void *Thread1(void *x) {
12 Global++;
13 return NULL;
16 void *Blacklisted_Thread2(void *x) {
17 Global--;
18 return NULL;
21 int main() {
22 pthread_t t[2];
23 pthread_create(&t[0], NULL, Thread1, NULL);
24 pthread_create(&t[1], NULL, Blacklisted_Thread2, NULL);
25 pthread_join(t[0], NULL);
26 pthread_join(t[1], NULL);
27 printf("PASS\n");
28 return 0;
31 // CHECK-NOT: ThreadSanitizer: data race