Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/memory: cover memmove #1142

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions tests/alive-tv/memory/memmove-memset-poison.srctgt.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
define void @src(ptr %src, ptr %dst) {
%load.src = load i32, ptr %src
store i32 poison, ptr %dst
%gep.dst.1 = getelementptr i32, ptr %dst, i64 1
store i32 %load.src, ptr %gep.dst.1
ret void
}

define void @tgt(ptr %src, ptr %dst) {
%gep.dst.1 = getelementptr i32, ptr %dst, i64 1
call void @llvm.memmove.p0.p0.i64(ptr %gep.dst.1, ptr %src, i64 4, i1 false)
call void @llvm.memset.p0.i64(ptr %dst, i8 poison, i64 4, i1 false)
ret void
}
10 changes: 10 additions & 0 deletions tests/alive-tv/memory/memmove.srctgt.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
define void @src(ptr %src, ptr %dst) {
%load.src = load i32, ptr %src
store i32 %load.src, ptr %dst
ret void
}

define void @tgt(ptr %src, ptr %dst) {
call void @llvm.memmove.p0.p0.i64(ptr %dst, ptr %src, i64 4, i1 false)
ret void
}
Loading