1 ! Check for various valid and erroneous "noreturn" cases.
6 !GCC$ ATTRIBUTES noreturn :: bar1
9 end subroutine bar1
! { dg-warning "'noreturn' function does return" "detect falling off end of noreturn" }
13 !GCC$ ATTRIBUTES noreturn :: foo1
14 end subroutine foo1
! { dg-warning "'noreturn' function does return" "detect falling off end of noreturn" }
17 !GCC$ ATTRIBUTES noreturn :: foo2
19 end subroutine foo2
! { dg-bogus "warning:" "this function should not get any warnings" }
22 end subroutine foo3
! { dg-bogus "warning:" "this function should not get any warnings" }
25 !GCC$ ATTRIBUTES noreturn :: foo4
27 end subroutine foo4
! { dg-bogus "warning:" "this function should not get any warnings" }
30 !GCC$ ATTRIBUTES noreturn :: foo5
31 return ! { dg-warning "'noreturn' function does return" "detect invalid return" }
36 end subroutine foo6
! { dg-bogus "warning:" "this function should not get any warnings" }
40 end subroutine foo7
! { dg-bogus "warning:" "this function should not get any warnings" }
43 !GCC$ ATTRIBUTES noreturn :: foo8
45 end subroutine foo8
! { dg-warning "'noreturn' function does return" "detect return from tail call" }
48 !GCC$ ATTRIBUTES noreturn :: foo9
51 !GCC$ ATTRIBUTES noreturn :: bar
55 end subroutine foo9
! { dg-bogus "warning:" "this function should not get any warnings" }
59 !GCC$ ATTRIBUTES noreturn :: ffo1
62 end function ffo1
! { dg-warning "'noreturn' function does return" "detect falling off end of noreturn" }