diff options
Diffstat (limited to 'llvm/test/Transforms/FunctionAttrs/nofree-attributor.ll')
-rw-r--r-- | llvm/test/Transforms/FunctionAttrs/nofree-attributor.ll | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/llvm/test/Transforms/FunctionAttrs/nofree-attributor.ll b/llvm/test/Transforms/FunctionAttrs/nofree-attributor.ll index ceb49d4a347..8ccb52fac6d 100644 --- a/llvm/test/Transforms/FunctionAttrs/nofree-attributor.ll +++ b/llvm/test/Transforms/FunctionAttrs/nofree-attributor.ll @@ -67,8 +67,15 @@ define void @free_in_scc1(i8* nocapture %0) local_unnamed_addr #0 { ; ATTRIBUTOR-NOT: nofree ; ATTRIBUTOR: define void @free_in_scc2(i8* nocapture %0) local_unnamed_addr define void @free_in_scc2(i8* nocapture %0) local_unnamed_addr #0 { - tail call void @free_in_scc1(i8* %0) + %cmp = icmp eq i8* %0, null + br i1 %cmp, label %rec, label %call +call: tail call void @free(i8* %0) #1 + br label %end +rec: + tail call void @free_in_scc1(i8* %0) + br label %end +end: ret void } @@ -85,7 +92,7 @@ define void @free_in_scc2(i8* nocapture %0) local_unnamed_addr #0 { ; FNATTR: Function Attrs: noinline nounwind readnone uwtable ; FNATTR-NEXT: define void @mutual_recursion1() -; ATTRIBUTOR: Function Attrs: nofree noinline nosync nounwind uwtable +; ATTRIBUTOR: Function Attrs: nofree noinline noreturn nosync nounwind uwtable ; ATTRIBUTOR-NEXT: define void @mutual_recursion1() define void @mutual_recursion1() #0 { call void @mutual_recursion2() @@ -94,7 +101,7 @@ define void @mutual_recursion1() #0 { ; FNATTR: Function Attrs: noinline nounwind readnone uwtable ; FNATTR-NEXT: define void @mutual_recursion2() -; ATTRIBUTOR: Function Attrs: nofree noinline nosync nounwind uwtable +; ATTRIBUTOR: Function Attrs: nofree noinline noreturn nosync nounwind uwtable ; ATTRIBUTOR-NEXT: define void @mutual_recursion2() define void @mutual_recursion2() #0 { call void @mutual_recursion1() |