RISC-V: Regenerate opt urls.
[official-gcc.git] / gcc / testsuite / gfortran.dg / multiple_allocation_1.f90
bloba7e8fe5fae18fdfba6dd3e3b7f7103cb0cb6f60b
1 ! { dg-do run }
2 ! PR 25031 - We didn't cause an error when allocating an already
3 ! allocated array.
5 ! This testcase has been modified to fix PR 49755.
6 program alloc_test
7 implicit none
8 integer :: i
9 integer, allocatable :: a(:)
10 integer, pointer :: b(:)
12 allocate(a(4))
13 ! This should set the stat code but not change the size.
14 allocate(a(3),stat=i)
15 if (i == 0) STOP 1
16 if (.not. allocated(a)) STOP 2
17 if (size(a) /= 4) STOP 3
19 ! It's OK to allocate pointers twice (even though this causes
20 ! a memory leak)
21 allocate(b(4))
22 allocate(b(4))
23 end program