mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-24 22:32:47 +00:00
f04d8d1593
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48483 91177308-0d34-0410-b5e6-96231b3b80d8
20 lines
665 B
LLVM
20 lines
665 B
LLVM
; This test makes sure that memmove instructions are properly eliminated.
|
|
;
|
|
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | \
|
|
; RUN: not grep {call void @llvm.memmove}
|
|
|
|
@S = internal constant [33 x i8] c"panic: restorelist inconsistency\00" ; <[33 x i8]*> [#uses=1]
|
|
|
|
declare void @llvm.memmove.i32(i8*, i8*, i32, i32)
|
|
|
|
define void @test1(i8* %A, i8* %B, i32 %N) {
|
|
call void @llvm.memmove.i32( i8* %A, i8* %B, i32 0, i32 1 )
|
|
ret void
|
|
}
|
|
|
|
define void @test2(i8* %A, i32 %N) {
|
|
;; dest can't alias source since we can't write to source!
|
|
call void @llvm.memmove.i32( i8* %A, i8* getelementptr ([33 x i8]* @S, i32 0, i32 0), i32 %N, i32 1 )
|
|
ret void
|
|
}
|