Skip to content

Commit 914b617

Browse files
committed
Add an IR test adhering the suggestion of the reviewer
1 parent 08b4006 commit 914b617

File tree

1 file changed

+15
-0
lines changed
  • llvm/test/Instrumentation/ThreadSanitizer

1 file changed

+15
-0
lines changed

llvm/test/Instrumentation/ThreadSanitizer/capture.ll

+15
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,21 @@ entry:
4747
; CHECK: __tsan_write
4848
; CHECK: ret void
4949

50+
define void @captured3() nounwind uwtable sanitize_thread {
51+
entry:
52+
%stkobj = alloca [2 x i32], align 8
53+
; escapes due to store into global
54+
store ptr %stkobj, ptr @sink, align 8
55+
; derived is captured as its base object is captured
56+
%derived = getelementptr inbounds i32, ptr %stkobj, i64 1
57+
store i32 42, ptr %derived, align 4
58+
ret void
59+
}
60+
; CHECK-LABEL: define void @captured3
61+
; CHECK: __tsan_write
62+
; CHECK: __tsan_write
63+
; CHECK: ret void
64+
5065
define void @notcaptured0() nounwind uwtable sanitize_thread {
5166
entry:
5267
%ptr = alloca i32, align 4

0 commit comments

Comments
 (0)