[BasicAA] Add test for byval argument (NFC)

This commit is contained in:
Nikita Popov 2020-12-20 21:56:23 +01:00
parent 64e4757200
commit bfa95b4ac7
1 changed files with 15 additions and 4 deletions

View File

@ -2,16 +2,18 @@
declare i32* @captures(i32* %cap) nounwind readonly
; CHECK-LABEL: no
; CHECK: NoAlias: i32* %a, i32* %b
define void @no(i32* noalias %a, i32* %b) nounwind {
entry:
store i32 1, i32* %a
store i32 1, i32* %a
%cap = call i32* @captures(i32* %a) nounwind readonly
%l = load i32, i32* %b
ret void
}
; CHECK: NoAlias: i32* %a, i32* %b
; CHECK-LABEL: yes
; CHECK: MayAlias: i32* %c, i32* %d
define void @yes(i32* %c, i32* %d) nounwind {
entry:
store i32 1, i32* %c
@ -20,4 +22,13 @@ entry:
ret void
}
; CHECK: MayAlias: i32* %c, i32* %d
; TODO: Result should be the same for byval instead of noalias.
; CHECK-LABEL: byval
; CHECK: MayAlias: i32* %a, i32* %b
define void @byval(i32* byval(i32) %a, i32* %b) nounwind {
entry:
store i32 1, i32* %a
%cap = call i32* @captures(i32* %a) nounwind readonly
%l = load i32, i32* %b
ret void
}