diff options
author | Chris Lattner <sabre@nondot.org> | 2004-02-12 17:53:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-02-12 17:53:43 +0000 |
commit | cb7cb71bc8f3e6802cda82164a4179e05ff2404e (patch) | |
tree | aef35b5aa77a35f6b3773eed6553567ae286a7a5 /test | |
parent | 915e5e56d7cc8e140d33202eed6244ed0356ed1f (diff) |
Test that we get rep movs when calling memcpy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11352 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/X86/2004-02-12-Memcpy.llx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/CodeGen/X86/2004-02-12-Memcpy.llx b/test/CodeGen/X86/2004-02-12-Memcpy.llx new file mode 100644 index 0000000000..13b4bf3112 --- /dev/null +++ b/test/CodeGen/X86/2004-02-12-Memcpy.llx @@ -0,0 +1,24 @@ +; RUN: llvm-as < %s | llc -march=x86 | grep movs +declare sbyte* %llvm.memcpy(sbyte* %A, sbyte* %B, uint %amt, uint %align) + +%A = global [1000 x int] zeroinitializer +%B = global [1000 x int] zeroinitializer + + +void %main() { + ; dword copy + call sbyte* %llvm.memcpy(sbyte* cast (int* getelementptr ([1000 x int]* %A, long 0, long 0) to sbyte*), + sbyte* cast (int* getelementptr ([1000 x int]* %B, long 0, long 0) to sbyte*), + uint 4000, uint 4) + + ; word copy + call sbyte* %llvm.memcpy(sbyte* cast (int* getelementptr ([1000 x int]* %A, long 0, long 0) to sbyte*), + sbyte* cast (int* getelementptr ([1000 x int]* %B, long 0, long 0) to sbyte*), + uint 4000, uint 2) + + ; byte copy + call sbyte* %llvm.memcpy(sbyte* cast (int* getelementptr ([1000 x int]* %A, long 0, long 0) to sbyte*), + sbyte* cast (int* getelementptr ([1000 x int]* %B, long 0, long 0) to sbyte*), + uint 4000, uint 1) + ret void +} |