xref: /llvm-project/llvm/test/Transforms/ADCE/willreturn.ll (revision 3f8027fb67bc4efae9959a4d75f8f37ecf0c3985)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2; RUN: opt -passes=adce -S < %s | FileCheck %s
3
4declare void @may_not_return(i32) nounwind readnone
5declare void @will_return(i32) nounwind readnone willreturn
6
7define void @test(i32 %a) {
8; CHECK-LABEL: @test(
9; CHECK-NEXT:    [[B:%.*]] = add i32 [[A:%.*]], 1
10; CHECK-NEXT:    call void @may_not_return(i32 [[B]])
11; CHECK-NEXT:    ret void
12;
13  %b = add i32 %a, 1
14  call void @may_not_return(i32 %b)
15  %c = add i32 %b, 1
16  call void @will_return(i32 %c)
17  ret void
18}
19