mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-17 03:07:06 +00:00
69ccadd753
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32115 91177308-0d34-0410-b5e6-96231b3b80d8
24 lines
719 B
LLVM
24 lines
719 B
LLVM
; This test makes sure that memmove instructions are properly eliminated.
|
|
;
|
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep 'call void %llvm.memmove'
|
|
|
|
%S = internal constant [33 x sbyte] c"panic: restorelist inconsistency\00"
|
|
|
|
implementation
|
|
|
|
declare void %llvm.memmove(sbyte*, sbyte*, uint, uint)
|
|
|
|
void %test1(sbyte* %A, sbyte* %B, uint %N) {
|
|
;; 0 bytes -> noop.
|
|
call void %llvm.memmove(sbyte* %A, sbyte* %B, uint 0, uint 1)
|
|
ret void
|
|
}
|
|
|
|
void %test2(sbyte *%A, uint %N) {
|
|
;; dest can't alias source since we can't write to source!
|
|
call void %llvm.memmove(sbyte* %A, sbyte* getelementptr ([33 x sbyte]* %S, int 0, int 0),
|
|
uint %N, uint 1)
|
|
ret void
|
|
}
|