1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -inline -S -enable-new-pm=0 %s | FileCheck %s
4 ; readnone but may not return according to attributes.
5 define void @readnone_may_not_return() nounwind readnone ssp {
6 ; CHECK-LABEL: @readnone_may_not_return(
8 ; CHECK-NEXT: br label [[WHILE_BODY:%.*]]
10 ; CHECK-NEXT: br label [[WHILE_BODY]]
19 ; readnone and guaranteed to return according to attributes.
20 define void @readnone_willreturn() willreturn nounwind readnone ssp {
21 ; CHECK-LABEL: @readnone_willreturn(
23 ; CHECK-NEXT: ret void
29 ; Make sure the call to @readnone is not treated as dead, because it is not
30 ; marked as willreturn.
31 define void @caller_may_not_return() ssp {
32 ; CHECK-LABEL: @caller_may_not_return(
34 ; CHECK-NEXT: br label [[WHILE_BODY_I:%.*]]
35 ; CHECK: while.body.i:
36 ; CHECK-NEXT: br label [[WHILE_BODY_I]]
37 ; CHECK: readnone_may_not_return.exit:
38 ; CHECK-NEXT: ret void
41 call void @readnone_may_not_return()
42 call void @readnone_willreturn()
46 ; @caller_willreturn is marked as willreturn, so all called functions also must
47 ; return. All calls are dead.
48 define void @caller_willreturn() ssp {
49 ; CHECK-LABEL: @caller_willreturn(
51 ; CHECK-NEXT: ret void
54 call void @readnone_may_not_return() willreturn
55 call void @readnone_willreturn()