OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [multiple_allocation_3.f90] - Blame information for rev 694

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! PR 49755 - If allocating an already allocated array, and stat=
3
!            is given, set stat to non zero and do not touch the array.
4
program test
5
    integer, allocatable :: A(:, :)
6
    integer :: stat
7
 
8
    allocate(A(20,20))
9
    A = 42
10
 
11
    ! Allocate of already allocated variable
12
    allocate (A(5,5), stat=stat)
13
 
14
    ! Expected: Error stat and previous allocation status
15
    if (stat == 0) call abort ()
16
    if (any (shape (A) /= [20, 20])) call abort ()
17
    if (any (A /= 42)) call abort ()
18
end program
19
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.