1 ; RUN: opt < %s -basicaa -memcpyopt -S | FileCheck %s
3 target datalayout = "e"
6 declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i1) nounwind
11 call void @foo(i8* %ptr2)
12 call void @llvm.memcpy.p0i8.p0i8.i32(i8* %ptr1, i8* %ptr2, i32 1, i1 false)
13 call void @foo(i8* %ptr1)
16 ; Check that the transformation isn't applied if the called function can
17 ; capture the pointer argument (i.e. the nocapture attribute isn't present)
19 ; CHECK: call void @foo(i8* %ptr2)
20 ; CHECK-NEXT: call void @llvm.memcpy
21 ; CHECK-NEXT: call void @foo(i8* %ptr1)