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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! Tests the fix for PR33566, in which the first variable array ref
3
! to v1 would cause an incompatible ranks error and the second an ICE.
4
!
5
! Contributed by Mikael Morin 
6
!
7
      program test_vec
8
 
9
      implicit none
10
 
11
 
12
      integer :: i
13
      real    :: x
14
 
15
      type vec3
16
        real, dimension(3) :: coords
17
      end type vec3
18
 
19
      type(vec3),parameter :: v1 = vec3((/ 1.0, 2.0, 3.0 /))
20
      type(vec3)           :: v2
21
 
22
      v2 = vec3((/ 1.0, 2.0, 3.0 /))
23
 
24
 
25
      x = v1%coords(1)
26
 
27
      do i=1,3
28
        x = v1%coords(i)  ! used to fail
29
        x = v2%coords(i)
30
      end do
31
 
32
      i = 2
33
 
34
      v2 = vec3 (v1%coords ((/i+1, i, i-1/))) ! also broken
35
 
36
      end program test_vec

powered by: WebSVN 2.1.0

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