1 ; RUN: opt < %s -tsan -S | FileCheck %s 2 3 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" 4 5 define void @IncrementMe(i32* nocapture %ptr) nounwind uwtable sanitize_thread { 6 entry: 7 %0 = load i32, i32* %ptr, align 4 8 %inc = add nsw i32 %0, 1 9 store i32 %inc, i32* %ptr, align 4 10 ret void 11 } 12 ; CHECK: define void @IncrementMe 13 ; CHECK-NOT: __tsan_read 14 ; CHECK: __tsan_write 15 ; CHECK: ret void 16 17 define void @IncrementMeWithCallInBetween(i32* nocapture %ptr) nounwind uwtable sanitize_thread { 18 entry: 19 %0 = load i32, i32* %ptr, align 4 20 %inc = add nsw i32 %0, 1 21 call void @foo() 22 store i32 %inc, i32* %ptr, align 4 23 ret void 24 } 25 26 ; CHECK: define void @IncrementMeWithCallInBetween 27 ; CHECK: __tsan_read 28 ; CHECK: __tsan_write 29 ; CHECK: ret void 30 31 declare void @foo() 32 33