aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/2004-02-12-Memcpy.llx
blob: ab403432585b39aa43cc291a0e37fa577069f681 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
; RUN: llvm-upgrade < %s | llvm-as | 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
}