File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
llvm/test/Analysis/BasicAA Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -40,3 +40,42 @@ define void @address_capture_and_full_capture() {
4040 load i32 , ptr %a
4141 ret void
4242}
43+
44+ ; CHECK-LABEL: address_capture_and_full_capture_commuted
45+ ; CHECK: MayAlias: i32* %a, i32* %p
46+ ; CHECK: Both ModRef: Ptr: i32* %a <-> %p = call ptr @get_ptr()
47+ define void @address_capture_and_full_capture_commuted () {
48+ %a = alloca i32
49+ call void @capture (ptr %a )
50+ call void @capture (ptr captures(address) %a )
51+ %p = call ptr @get_ptr ()
52+ store i32 0 , ptr %p
53+ load i32 , ptr %a
54+ ret void
55+ }
56+
57+ ; CHECK-LABEL: read_only_capture_and_full_capture
58+ ; CHECK: MayAlias: i32* %a, i32* %p
59+ ; CHECK: Both ModRef: Ptr: i32* %a <-> %p = call ptr @get_ptr()
60+ define void @read_only_capture_and_full_capture () {
61+ %a = alloca i32
62+ call void @capture (ptr captures(address, read_provenance) %a )
63+ call void @capture (ptr %a )
64+ %p = call ptr @get_ptr ()
65+ store i32 0 , ptr %p
66+ load i32 , ptr %a
67+ ret void
68+ }
69+
70+ ; CHECK-LABEL: read_only_capture_and_full_capture_commuted
71+ ; CHECK: MayAlias: i32* %a, i32* %p
72+ ; CHECK: Both ModRef: Ptr: i32* %a <-> %p = call ptr @get_ptr()
73+ define void @read_only_capture_and_full_capture_commuted () {
74+ %a = alloca i32
75+ call void @capture (ptr %a )
76+ call void @capture (ptr captures(address, read_provenance) %a )
77+ %p = call ptr @get_ptr ()
78+ store i32 0 , ptr %p
79+ load i32 , ptr %a
80+ ret void
81+ }
You can’t perform that action at this time.
0 commit comments