mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-26 07:29:55 +00:00
memory just like a store" with bug fixed (partial-overwrite.ll is the regression test). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86667 91177308-0d34-0410-b5e6-96231b3b80d8
48 lines
877 B
LLVM
48 lines
877 B
LLVM
; RUN: opt -S -dse < %s | FileCheck %s
|
|
|
|
declare void @llvm.memcpy.i8(i8*, i8*, i8, i32)
|
|
declare void @llvm.memmove.i8(i8*, i8*, i8, i32)
|
|
declare void @llvm.memset.i8(i8*, i8, i8, i32)
|
|
|
|
define void @test1() {
|
|
; CHECK: @test1
|
|
%A = alloca i8
|
|
%B = alloca i8
|
|
|
|
store i8 0, i8* %A ;; Written to by memcpy
|
|
; CHECK-NOT: store
|
|
|
|
call void @llvm.memcpy.i8(i8* %A, i8* %B, i8 -1, i32 0)
|
|
|
|
ret void
|
|
; CHECK: ret void
|
|
}
|
|
|
|
define void @test2() {
|
|
; CHECK: @test2
|
|
%A = alloca i8
|
|
%B = alloca i8
|
|
|
|
store i8 0, i8* %A ;; Written to by memmove
|
|
; CHECK-NOT: store
|
|
|
|
call void @llvm.memmove.i8(i8* %A, i8* %B, i8 -1, i32 0)
|
|
|
|
ret void
|
|
; CHECK: ret void
|
|
}
|
|
|
|
define void @test3() {
|
|
; CHECK: @test3
|
|
%A = alloca i8
|
|
%B = alloca i8
|
|
|
|
store i8 0, i8* %A ;; Written to by memset
|
|
; CHECK-NOT: store
|
|
|
|
call void @llvm.memset.i8(i8* %A, i8 0, i8 -1, i32 0)
|
|
|
|
ret void
|
|
; CHECK: ret void
|
|
}
|