; Test that the StrCatOptimizer works correctly
; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | grep strlen
; XFAIL: *

declare sbyte* %strcat(sbyte*,sbyte*)
%hello = constant [6 x sbyte] c"hello\00"

implementation   ; Functions:

int %main () {
  %target = alloca [1024 x sbyte]
  %arg1 = getelementptr [1024 x sbyte]* %target, int 0, int 0
  %arg2 = getelementptr [6 x sbyte]* %hello, int 0, int 0
  %rslt = call sbyte* %strcat(sbyte* %arg1, sbyte* %arg2)
  ret int 0
}

; Test that the StrCatOptimizer works correctly
; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | grep strlen
; XFAIL: *

declare sbyte* %strcat(sbyte*,sbyte*)
%hello = constant [6 x sbyte] c"hello\00"

implementation   ; Functions:

int %main () {
  %target = alloca [1024 x sbyte]
  %arg1 = getelementptr [1024 x sbyte]* %target, int 0, int 0
  store sbyte 0, sbyte* %arg1
  %arg2 = getelementptr [6 x sbyte]* %hello, int 0, int 0
  %rslt = call sbyte* %strcat(sbyte* %arg1, sbyte* %arg2)
  ret int 0
}

Make sure the target buffer is null terminated so we don't blow up strcat when its called.
Make sure the target buffer is null terminated so we don't blow up
strcat when its called.


git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@21533 91177308-0d34-0410-b5e6-96231b3b80d8
