1 // RUN: %clangxx_tsan -O1 -DTEST_ERROR=ERANGE %s -o %t && %run %t 2>&1 | FileCheck --check-prefixes=CHECK,CHECK-SYS %s
2 // RUN: %clangxx_tsan -O1 -DTEST_ERROR=-1 %s -o %t && not %run %t 2>&1 | FileCheck --check-prefixes=CHECK,CHECK-USER %s
3 // This test is for GNU specific version of strerror_r()
4 // UNSUPPORTED: darwin, target={{.*(netbsd|freebsd).*}}
14 void *Thread(void *p
) {
15 barrier_wait(&barrier
);
16 return strerror_r(TEST_ERROR
, buffer
, sizeof(buffer
));
20 barrier_init(&barrier
, 2);
22 pthread_create(&th
, 0, Thread
, 0);
23 strerror_r(TEST_ERROR
, buffer
, sizeof(buffer
));
24 barrier_wait(&barrier
);
26 fprintf(stderr
, "DONE\n");
29 // CHECK-USER: WARNING: ThreadSanitizer: data race
30 // CHECK-SYS-NOT: WARNING: ThreadSanitizer: data race