OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [derived_comp_array_ref_5.f90] - Blame information for rev 322

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 302 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.