[tsan] Modify the tls_race.cc and tls_race2.cc tests to pass on OS X

On OS X, __thread variables are lazily heap-allocated (with malloc). Therefore, they're recognized as heap blocks (which is what they are) and not as TLS variables in TSan reports. Figuring out if a heap block is a TLS or not is difficult (in malloc interceptor we could analyze the caller and then mark the object), so let's instead modify the tests so that we expect the report to say "Location is heap block" instead of "Location is TLS".

Differential Revision: http://reviews.llvm.org/D14873

llvm-svn: 253858
This commit is contained in:
Kuba Brecka 2015-11-23 08:17:17 +00:00
parent de2d7593a2
commit 2f8d345adc
2 changed files with 8 additions and 5 deletions

View File

@ -1,4 +1,4 @@
// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
#include "test.h"
void *Thread(void *a) {
@ -18,4 +18,6 @@ int main() {
}
// CHECK: WARNING: ThreadSanitizer: data race
// CHECK: Location is TLS of main thread.
// CHECK-Linux: Location is TLS of main thread.
// CHECK-FreeBSD: Location is TLS of main thread.
// CHECK-Darwin: Location is heap block of size 4

View File

@ -1,4 +1,4 @@
// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
// RUN: %clangxx_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
#include "test.h"
void *Thread2(void *a) {
@ -25,5 +25,6 @@ int main() {
}
// CHECK: WARNING: ThreadSanitizer: data race
// CHECK: Location is TLS of thread T1.
// CHECK-Linux: Location is TLS of thread T1.
// CHECK-FreeBSD: Location is TLS of thread T1.
// CHECK-Darwin: Location is heap block of size 4