1 ; RUN: opt < %s -lint -disable-output 2>&1 | FileCheck %s
5 ; Function Attrs: argmemonly nounwind
6 declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture writeonly, i8* nocapture readonly, i32, i1) #0
8 ; Function Attrs: argmemonly nounwind
9 declare void @llvm.memset.p0i8.i32(i8* nocapture writeonly, i8, i32, i1) #0
11 declare void @f1(%s* noalias nocapture sret, %s* nocapture readnone)
17 %0 = bitcast %s* %c to i8*
18 %1 = bitcast %s* %tmp to i8*
19 call void @llvm.memset.p0i8.i32(i8* %0, i8 0, i32 1, i1 false)
20 call void @f1(%s* sret %c, %s* %c)
24 ; Lint should complain about us passing %c to both arguments since one of them
26 ; CHECK: Unusual: noalias argument aliases another argument
27 ; CHECK-NEXT: call void @f1(%s* sret %c, %s* %c)
29 declare void @f3(%s* noalias nocapture sret, %s* byval nocapture readnone)
35 %0 = bitcast %s* %c to i8*
36 %1 = bitcast %s* %tmp to i8*
37 call void @llvm.memset.p0i8.i32(i8* %0, i8 0, i32 1, i1 false)
38 call void @f3(%s* sret %c, %s* byval %c)
42 ; Lint should not complain about passing %c to both arguments even if one is
43 ; noalias, since the other one is byval, effectively copying the data to the
44 ; stack instead of passing the pointer itself.
45 ; CHECK-NOT: Unusual: noalias argument aliases another argument
46 ; CHECK-NOT: call void @f3(%s* sret %c, %s* %c)
48 attributes #0 = { argmemonly nounwind }