Tired of wading through cvs's list ? files that are generated when building
[oota-llvm.git] / test / Transforms / SimplifyLibCalls / MemCpy.ll
1 ; Test that the StrCatOptimizer works correctly
2 ; RUN: llvm-as < %s | opt -constprop -simplify-libcalls -disable-output &&
3 ; RUN: llvm-as < %s | opt -constprop -simplify-libcalls | llvm-dis | not grep 'call.*llvm.memcpy'
4
5 declare sbyte* %llvm.memcpy(sbyte*,sbyte*,int,int)
6 %h = constant [2 x sbyte] c"h\00"
7 %hel = constant [4 x sbyte] c"hel\00"
8 %hello_u = constant [8 x sbyte] c"hello_u\00"
9
10 implementation   ; Functions:
11
12 int %main () {
13   %h_p = getelementptr [2 x sbyte]* %h, int 0, int 0
14   %hel_p = getelementptr [4 x sbyte]* %hel, int 0, int 0
15   %hello_u_p = getelementptr [8 x sbyte]* %hello_u, int 0, int 0
16   %target = alloca [1024 x sbyte]
17   %target_p = getelementptr [1024 x sbyte]* %target, int 0, int 0
18   call sbyte* %llvm.memcpy(sbyte* %target_p, sbyte* %h_p, int 2, int 2)
19   call sbyte* %llvm.memcpy(sbyte* %target_p, sbyte* %hel_p, int 4, int 4)
20   call sbyte* %llvm.memcpy(sbyte* %target_p, sbyte* %hello_u_p, int 8, int 8)
21   ret int 0
22 }