upgrade and filecheckize this test.
[oota-llvm.git] / test / CodeGen / X86 / memcpy.ll
1 ; RUN: llc < %s -march=x86-64 | FileCheck %s
2
3 declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
4
5
6 ; Variable memcpy's should lower to calls.
7 define i8* @test1(i8* %a, i8* %b, i64 %n) nounwind {
8 entry:
9         tail call void @llvm.memcpy.p0i8.p0i8.i64( i8* %a, i8* %b, i64 %n, i32 1, i1 0 )
10         ret i8* %a
11         
12 ; CHECK: test1:
13 ; CHECK: memcpy
14 }
15
16 ; Variable memcpy's should lower to calls.
17 define i8* @test2(i64* %a, i64* %b, i64 %n) nounwind {
18 entry:
19         %tmp14 = bitcast i64* %a to i8*
20         %tmp25 = bitcast i64* %b to i8*
21         tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp14, i8* %tmp25, i64 %n, i32 8, i1 0 )
22         ret i8* %tmp14
23         
24 ; CHECK: test2:
25 ; CHECK: memcpy
26 }
27