1 ; RUN: opt < %s -passes=lint -disable-output 2>&1 | FileCheck %s
5 ; Function Attrs: argmemonly nounwind
6 declare void @llvm.memcpy.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1) #0
8 ; Function Attrs: argmemonly nounwind
9 declare void @llvm.memset.p0.i32(ptr nocapture writeonly, i8, i32, i1) #0
11 declare void @f1(ptr noalias nocapture sret(%s), ptr nocapture)
17 call void @llvm.memset.p0.i32(ptr %c, i8 0, i32 1, i1 false)
18 call void @f1(ptr sret(%s) %c, ptr %c)
22 ; Lint should complain about us passing %c to both arguments since one of them
24 ; CHECK: Unusual: noalias argument aliases another argument
25 ; CHECK-NEXT: call void @f1(ptr sret(%s) %c, ptr %c)
27 declare void @f3(ptr noalias nocapture sret(%s), ptr byval(%s) nocapture readnone)
33 call void @llvm.memset.p0.i32(ptr %c, i8 0, i32 1, i1 false)
34 call void @f3(ptr sret(%s) %c, ptr byval(%s) %c)
38 ; Lint should not complain about passing %c to both arguments even if one is
39 ; noalias, since the other one is byval, effectively copying the data to the
40 ; stack instead of passing the pointer itself.
41 ; CHECK-NOT: Unusual: noalias argument aliases another argument
42 ; CHECK-NOT: call void @f3(ptr sret(%s) %c, ptr byval(%s) %c)
44 attributes #0 = { argmemonly nounwind }