llvm.org GIT mirror llvm / 63485bd
Merging r276015: ------------------------------------------------------------------------ r276015 | vedantk | 2016-07-19 13:16:08 -0700 (Tue, 19 Jul 2016) | 7 lines [tsan] Don't instrument __llvm_gcov_global_state_pred or __llvm_gcda* r274801 did not go far enough to allow gcov+tsan to cooperate. With this commit it's possible to run the following code without false positives: std::thread T1(fib), T2(fib); T1.join(); T2.join(); ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_39@276810 91177308-0d34-0410-b5e6-96231b3b80d8 Hans Wennborg 4 years ago
2 changed file(s) with 16 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
271271 return false;
272272 }
273273
274 // Check if the global is in a GCOV counter array.
275 if (GV->getName().startswith("__llvm_gcov_ctr"))
274 // Check if the global is private gcov data.
275 if (GV->getName().startswith("__llvm_gcov") ||
276 GV->getName().startswith("__llvm_gcda"))
276277 return false;
277278 }
278279
1212
1313 @__llvm_gcov_ctr = internal global [1 x i64] zeroinitializer
1414 @__llvm_gcov_ctr.1 = internal global [1 x i64] zeroinitializer
15 @__llvm_gcov_global_state_pred = internal global i32 0
16 @__llvm_gcda_foo = internal global i32 0
1517
1618 define i32 @test_gep() sanitize_thread {
1719 entry:
4143 ret i32 undef
4244 }
4345
46 define void @test_load() sanitize_thread {
47 entry:
48 %0 = load i32, i32* @__llvm_gcov_global_state_pred
49 store i32 1, i32* @__llvm_gcov_global_state_pred
50
51 %1 = load i32, i32* @__llvm_gcda_foo
52 store i32 1, i32* @__llvm_gcda_foo
53
54 ret void
55 }
56
4457 ; CHECK-NOT: {{call void @__tsan_write}}
4558 ; CHECK: __tsan_init