diff options
author | Chris Lattner <sabre@nondot.org> | 2004-10-12 04:51:55 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-10-12 04:51:55 +0000 |
commit | b18dfebb3aa13339305691af600563c6a7f50db3 (patch) | |
tree | f0c554b2101c59656790c210e6088e7693f344c1 /test/Transforms/InstCombine/memmove.ll | |
parent | 84e48b860d9d864ccdbfa9c7b35a9ee4d74650f6 (diff) |
New testcase for memmove -> memcpy transform
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16931 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/memmove.ll')
-rw-r--r-- | test/Transforms/InstCombine/memmove.ll | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/memmove.ll b/test/Transforms/InstCombine/memmove.ll new file mode 100644 index 0000000000..1313d341c0 --- /dev/null +++ b/test/Transforms/InstCombine/memmove.ll @@ -0,0 +1,23 @@ +; This test makes sure that memmove instructions are properly eliminated. +; + +; RUN: llvm-as < %s | 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 +} |