blob: 0a99488197bedab903dd8c208614e276ea7d4627 [file] [log] [blame]
Reid Spencer4ac0f212005-04-26 07:40:40 +00001; Test that the StrCatOptimizer works correctly
Reid Spencer43b40032007-04-16 15:31:49 +00002; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -simplify-libcalls | \
3; RUN: llvm-dis | not grep {call.*llvm.memcpy.i32}
Reid Spencer4ac0f212005-04-26 07:40:40 +00004
Reid Spencer2e7e4f22006-12-02 20:41:53 +00005declare void %llvm.memcpy.i32(sbyte*,sbyte*,uint,uint)
Reid Spencer4ac0f212005-04-26 07:40:40 +00006%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
10implementation ; Functions:
11
12int %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
Reid Spencer2e7e4f22006-12-02 20:41:53 +000018 call void %llvm.memcpy.i32(sbyte* %target_p, sbyte* %h_p, uint 2, uint 2)
19 call void %llvm.memcpy.i32(sbyte* %target_p, sbyte* %hel_p, uint 4, uint 4)
20 call void %llvm.memcpy.i32(sbyte* %target_p, sbyte* %hello_u_p, uint 8, uint 8)
Reid Spencer4ac0f212005-04-26 07:40:40 +000021 ret int 0
22}