URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [coarray_15.f90] - Rev 801
Go to most recent revision | Compare with Previous | Blame | View Log
! { dg-do run }! { dg-options "-fcoarray=single" }!! PR fortran/18918!! Contributed by John Reid.!program ex2implicit nonereal, allocatable :: z(:)[:]integer :: imagecharacter(len=128) :: strallocate(z(3)[*])write(*,*) 'z allocated on image',this_image()sync allif (this_image()==1) thenz = 1.2do image = 2, num_images() ! { dg-warning "will be executed zero times" }write(*,*) 'Assigning z(:) on image',imagez(:)[image] = zend doend ifsync allstr = repeat('X', len(str))write(str,*) 'z=',z(:),' on image',this_image()if (str /= " z= 1.20000005 1.20000005 1.20000005 on image 1") &call abortstr = repeat('X', len(str))write(str,*) 'z=',z,' on image',this_image()if (str /= " z= 1.20000005 1.20000005 1.20000005 on image 1") &call abortstr = repeat('X', len(str))write(str,*) 'z=',z(1:3)[this_image()],' on image',this_image()if (str /= " z= 1.20000005 1.20000005 1.20000005 on image 1") &call abortcall ex2a()call ex5()endsubroutine ex2a()implicit nonereal, allocatable :: z(:,:)[:,:]integer :: imagecharacter(len=128) :: strallocate(z(2,2)[1,*])write(*,*) 'z allocated on image',this_image()sync allif (this_image()==1) thenz = 1.2do image = 2, num_images() ! { dg-warning "will be executed zero times" }write(*,*) 'Assigning z(:) on image',imagez(:,:)[1,image] = zend doend ifsync allstr = repeat('X', len(str))write(str,*) 'z=',z(:,:),' on image',this_image()if (str /= " z= 1.20000005 1.20000005 1.20000005 1.20000005 on image 1") &call abortstr = repeat('X', len(str))write(str,*) 'z=',z,' on image',this_image()if (str /= " z= 1.20000005 1.20000005 1.20000005 1.20000005 on image 1") &call abortend subroutine ex2asubroutine ex5implicit noneinteger :: mereal, save :: w(4)[*]character(len=128) :: strme = this_image()w = mestr = repeat('X', len(str))write(str,*) 'In main on image',this_image(), 'w= ',wif (str /= " In main on image 1 w= 1.00000000 1.00000000 1.00000000 1.00000000") &call abortstr = repeat('X', len(str))write(str,*) 'In main on image',this_image(), 'w= ',w(1:4)if (str /= " In main on image 1 w= 1.00000000 1.00000000 1.00000000 1.00000000") &call abortstr = repeat('X', len(str))write(str,*) 'In main on image',this_image(), 'w= ',w(:)[1]if (str /= " In main on image 1 w= 1.00000000 1.00000000 1.00000000 1.00000000") &call abortsync allcall ex5_sub(me,w)end subroutine ex5subroutine ex5_sub(n,w)implicit noneinteger :: nreal :: w(n)character(len=75) :: strstr = repeat('X', len(str))write(str,*) 'In sub on image',this_image(), 'w= ',wif (str /= " In sub on image 1 w= 1.00000000") &call abortend subroutine ex5_sub
Go to most recent revision | Compare with Previous | Blame | View Log
