forked from OSchip/llvm-project
[BasicAA] Add memset_chk libfunc tests.
This commit is contained in:
parent
c6bd63803f
commit
524ad6babb
|
@ -175,3 +175,37 @@ entry:
|
|||
store i8 3, i8* %b.gep.5
|
||||
ret i8* %res
|
||||
}
|
||||
|
||||
declare i8* @__memset_chk(i8* writeonly, i32, i64, i64)
|
||||
|
||||
; CHECK-LABEL: Function: test_memset_chk_const_size
|
||||
define i8* @test_memset_chk_const_size(i8* noalias %a, i64 %n) {
|
||||
; CHECK: Just Mod (MustAlias): Ptr: i8* %a <-> %res = tail call i8* @__memset_chk(i8* %a, i32 0, i64 4, i64 %n)
|
||||
; CHECK-NEXT: Just Mod: Ptr: i8* %res <-> %res = tail call i8* @__memset_chk(i8* %a, i32 0, i64 4, i64 %n)
|
||||
; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.1 <-> %res = tail call i8* @__memset_chk(i8* %a, i32 0, i64 4, i64 %n)
|
||||
; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.5 <-> %res = tail call i8* @__memset_chk(i8* %a, i32 0, i64 4, i64 %n)
|
||||
;
|
||||
entry:
|
||||
%res = tail call i8* @__memset_chk(i8* %a, i32 0, i64 4, i64 %n)
|
||||
%a.gep.1 = getelementptr i8, i8* %a, i32 1
|
||||
store i8 0, i8* %a.gep.1
|
||||
%a.gep.5 = getelementptr i8, i8* %a, i32 5
|
||||
store i8 1, i8* %a.gep.5
|
||||
ret i8* %res
|
||||
}
|
||||
|
||||
define i8* @test_memset_chk_variable_size(i8* noalias %a, i64 %n.1, i64 %n.2) {
|
||||
; CHECK-LABEL: Function: test_memset_chk_variable_size
|
||||
; CHECK: Just Mod (MustAlias): Ptr: i8* %a <-> %res = tail call i8* @__memset_chk(i8* %a, i32 0, i64 %n.1, i64 %n.2)
|
||||
; CHECK-NEXT: Just Mod: Ptr: i8* %res <-> %res = tail call i8* @__memset_chk(i8* %a, i32 0, i64 %n.1, i64 %n.2)
|
||||
; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.1 <-> %res = tail call i8* @__memset_chk(i8* %a, i32 0, i64 %n.1, i64 %n.2)
|
||||
; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.5 <-> %res = tail call i8* @__memset_chk(i8* %a, i32 0, i64 %n.1, i64 %n.2)
|
||||
;
|
||||
entry:
|
||||
%res = tail call i8* @__memset_chk(i8* %a, i32 0, i64 %n.1, i64 %n.2)
|
||||
%a.gep.1 = getelementptr i8, i8* %a, i32 1
|
||||
store i8 0, i8* %a.gep.1
|
||||
%a.gep.5 = getelementptr i8, i8* %a, i32 5
|
||||
store i8 1, i8* %a.gep.5
|
||||
ret i8* %res
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue