view gcc/testsuite/gfortran.dg/realloc_on_assign_16.f90 @ 128:fe568345ddd5

fix CbC-example
author mir3636
date Wed, 11 Apr 2018 19:32:28 +0900
parents 04ced10e8804
children 84e7813d76e9
line wrap: on
line source

! { dg-do run }
! Test the fix for PR56008
!
! Contributed by Stefan Mauerberger  <stefan.mauerberger@gmail.com>
!
PROGRAM main
    !USE MPI

    TYPE :: test_typ
        REAL, ALLOCATABLE :: a(:)
    END TYPE

    TYPE(test_typ) :: xx, yy
    TYPE(test_typ), ALLOCATABLE :: conc(:)

    !CALL MPI_INIT(i)

    xx = test_typ( [1.0,2.0] )
    yy = test_typ( [4.0,4.9] )

    conc = [ xx, yy ]

    if (any (int (10.0*conc(1)%a) .ne. [10,20])) call abort
    if (any (int (10.0*conc(2)%a) .ne. [40,49])) call abort

    !CALL MPI_FINALIZE(i)

END PROGRAM main