brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 05bd9dc Raw
41 lines · plain
1; RUN: opt < %s -passes=lint -disable-output 2>&1 | FileCheck %s2 3declare void @f1(ptr noalias readonly, ptr)4 5define void @f2(ptr %a) {6entry:7  call void @f1(ptr %a, ptr %a)8  ret void9}10 11; Lint should complain about us passing %a to both arguments, since the noalias12; argument may depend on writes to the other.13; CHECK: Unusual: noalias argument aliases another argument14; CHECK-NEXT: call void @f1(ptr %a, ptr %a)15 16declare void @f3(ptr noalias, ptr readonly)17 18define void @f4(ptr %a) {19entry:20  call void @f3(ptr %a, ptr %a)21  ret void22}23 24; Lint should complain about us passing %a to both arguments, since writes to25; the noalias argument may cause a dependency for the other.26; CHECK: Unusual: noalias argument aliases another argument27; CHECK-NEXT: call void @f3(ptr %a, ptr %a)28 29declare void @f5(ptr noalias readonly, ptr readonly)30 31define void @f6(ptr %a) {32entry:33  call void @f5(ptr %a, ptr %a)34  ret void35}36 37; Lint should not complain about passing %a to both arguments even if one is38; noalias, since they are both readonly and thus have no dependence.39; CHECK-NOT: Unusual: noalias argument aliases another argument40; CHECK-NOT: call void @f5(ptr %a, ptr %a)41