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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! Tests the fix for PR42309, in which the indexing of 'Q'
3
! was off by one.
4
!
5
! Contributed by Gilbert Scott 
6
!
7
PROGRAM X
8
  TYPE T
9
    INTEGER :: I
10
    REAL :: X
11
  END TYPE T
12
  TYPE(T), TARGET :: T1(0:3)
13
  INTEGER, POINTER :: P(:)
14
  REAL :: SOURCE(4) = [10., 20., 30., 40.]
15
 
16
  T1%I = [1, 2, 3, 4]
17
  T1%X = SOURCE
18
  P => T1%I
19
  CALL Z(P)
20
  IF (ANY (T1%I .NE. [999, 2, 999, 4])) CALL ABORT
21
  IF (ANY (T1%X .NE. SOURCE)) CALL ABORT
22
CONTAINS
23
  SUBROUTINE Z(Q)
24
    INTEGER, POINTER :: Q(:)
25
    Q(1:3:2) = 999
26
  END SUBROUTINE Z
27
END PROGRAM X
28
 

powered by: WebSVN 2.1.0

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