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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [reshape-alloc.f90] - Blame information for rev 302

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do run }
2
! PR 20074: This used to segfault at runtime.
3
! Test case contributed by "Alfredo Buttari" 
4
 
5
program tryreshape
6
 
7
  integer,allocatable :: vect1(:),resh1(:,:)
8
  integer,pointer :: vect(:),resh(:,:)
9
  integer :: vect2(2*4), resh2(2,4)
10
  integer :: r, s(2)
11
 
12
  r=2;  nb=4
13
 
14
  s(:)=(/r,nb/)
15
 
16
  allocate(vect(nb*r),vect1(nb*r))
17
  allocate(resh(r,nb),resh1(r,nb))
18
 
19
  vect =1
20
  vect1=1
21
  vect2=1
22
 
23
  resh2 = reshape(vect2,s)
24
  if (resh2(1,1) /= 1.0) call abort
25
 
26
  resh1 = reshape(vect1,s)
27
  if (resh1(1,1) /= 1.0) call abort
28
 
29
  resh = reshape(vect,s)
30
  if (resh(1,1) /= 1.0) call abort
31
 
32
end program tryreshape

powered by: WebSVN 2.1.0

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