blob: 6268f72291c2d6bc5c0f98c4e06b567ab3a905d9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
! { dg-final { scan-assembler-not "should_be_noreturn" } }
! PR 17758
! This checks that non-returning subroutines and statements
! really don't return by calling non-existing subroutines
! afterwards. These calls are supposed to be optimized away, so
! they won't show up in the generated assembly.
program main
character(len=5) :: c
c = '12345'
read(unit=c,fmt='(A)') i
select case(i)
case(1)
call abort
call abort_should_be_noreturn
case(2)
stop 65
call stop_numeric_should_be_noreturn
case(3)
stop "foobar"
call stop_string_should_be_noreturn
case(4)
call exit
call exit_should_be_noreturn
end select
end program main
|