2008-08-21 21:00:15 +00:00
|
|
|
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-pc-linux-gnu | grep movs | count 1
|
2004-02-12 17:53:43 +00:00
|
|
|
|
2007-08-27 10:18:20 +00:00
|
|
|
@A = global [32 x i32] zeroinitializer
|
|
|
|
@B = global [32 x i32] zeroinitializer
|
2004-02-12 17:53:43 +00:00
|
|
|
|
2007-08-27 10:18:20 +00:00
|
|
|
declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
|
2004-02-12 17:53:43 +00:00
|
|
|
|
2008-08-21 21:00:15 +00:00
|
|
|
define void @main() nounwind {
|
2004-02-12 17:53:43 +00:00
|
|
|
; dword copy
|
2007-08-27 10:18:20 +00:00
|
|
|
call void @llvm.memcpy.i32(i8* bitcast ([32 x i32]* @A to i8*),
|
|
|
|
i8* bitcast ([32 x i32]* @B to i8*),
|
|
|
|
i32 128, i32 4 )
|
2004-02-12 17:53:43 +00:00
|
|
|
|
|
|
|
; word copy
|
2007-08-27 10:18:20 +00:00
|
|
|
call void @llvm.memcpy.i32( i8* bitcast ([32 x i32]* @A to i8*),
|
|
|
|
i8* bitcast ([32 x i32]* @B to i8*),
|
|
|
|
i32 128, i32 2 )
|
2004-02-12 17:53:43 +00:00
|
|
|
|
|
|
|
; byte copy
|
2007-08-27 10:18:20 +00:00
|
|
|
call void @llvm.memcpy.i32( i8* bitcast ([32 x i32]* @A to i8*),
|
|
|
|
i8* bitcast ([32 x i32]* @B to i8*),
|
|
|
|
i32 128, i32 1 )
|
|
|
|
|
2004-02-12 17:53:43 +00:00
|
|
|
ret void
|
|
|
|
}
|