Skip to content

Commit 73e4a18

Browse files
committed
[Inliner] Add tests for bad propagationg of access attr for byval param; NFC
1 parent a31e834 commit 73e4a18

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

llvm/test/Transforms/Inline/access-attributes-prop.ll

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,3 +580,23 @@ define ptr @callee_bad_param_prop(ptr readonly %x) {
580580
%r = tail call ptr @llvm.ptrmask(ptr %x, i64 -1)
581581
ret ptr %r
582582
}
583+
584+
define dso_local void @foo_byval_readonly2(ptr readonly %p) {
585+
; CHECK-LABEL: define {{[^@]+}}@foo_byval_readonly2
586+
; CHECK-SAME: (ptr readonly [[P:%.*]]) {
587+
; CHECK-NEXT: call void @bar4(ptr [[P]])
588+
; CHECK-NEXT: ret void
589+
;
590+
call void @bar4(ptr %p)
591+
ret void
592+
}
593+
594+
define void @prop_byval_readonly2(ptr %p) {
595+
; CHECK-LABEL: define {{[^@]+}}@prop_byval_readonly2
596+
; CHECK-SAME: (ptr [[P:%.*]]) {
597+
; CHECK-NEXT: call void @bar4(ptr readonly [[P]])
598+
; CHECK-NEXT: ret void
599+
;
600+
call void @foo_byval_readonly2(ptr %p)
601+
ret void
602+
}

0 commit comments

Comments
 (0)