PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / deallocate_alloc_opt_3.f90
blob36f9a187a747b74d9a6ce03f067727173e4144e4
1 ! { dg-do run }
2 program a
4 implicit none
6 integer n
7 character(len=70) e1
8 character(len=30) e2
9 integer, allocatable :: i(:)
11 e1 = 'No error'
12 allocate(i(4))
13 deallocate(i, stat=n, errmsg=e1)
14 if (trim(e1) /= 'No error') STOP 1
16 e2 = 'No error'
17 allocate(i(4))
18 deallocate(i, stat=n, errmsg=e2)
19 if (trim(e2) /= 'No error') STOP 2
21 e1 = 'No error'
22 deallocate(i, stat=n, errmsg=e1)
23 if (trim(e1) /= 'Attempt to deallocate an unallocated object') STOP 3
25 e2 = 'No error'
26 deallocate(i, stat=n, errmsg=e2)
27 if (trim(e2) /= 'Attempt to deallocate an unall') STOP 4
29 end program a