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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [allocate_zerosize_3.f] - Blame information for rev 801

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

Line No. Rev Author Line
1 694 jeremybenn
C { dg-do run }
2
C Test the fix for PR35698, in which the negative size dimension would
3
C throw out the subsequent bounds.
4
C
5
C Contributed by Dick Hendrickson <dick.hendrickson@gmail.com>
6
C
7
      program try_lf0030
8
      call LF0030(10)
9
      end
10
 
11
      SUBROUTINE LF0030(nf10)
12
      INTEGER ILA1(7)
13
      INTEGER ILA2(7)
14
      LOGICAL LLA(:,:,:,:,:,:,:)
15
      INTEGER ICA(7)
16
      ALLOCATABLE LLA
17
 
18
 
19
      ALLOCATE (LLA(2:3, 4, 0:5,
20
     $          NF10:1, -2:7, -3:8,
21
     $          -4:9))
22
 
23
      ILA1 = LBOUND(LLA)
24
      ILA2 = UBOUND(LLA)
25
C     CORRECT FOR THE ZERO DIMENSIONED TERM TO ALLOW AN EASIER VERIFY
26
      ILA1(4) = ILA1(4) - 2    !   1 - 2 = -1
27
      ILA2(4) = ILA2(4) + 6    !   0 + 6 = 6     
28
 
29
      DO J1 = 1,7
30
      IVAL = 3-J1
31
      IF (ILA1(J1) .NE. IVAL) call abort ()
32
  100 ENDDO
33
 
34
      DO J1 = 1,7
35
      IVAL = 2+J1
36
      IF (ILA2(J1) .NE. IVAL) call abort ()
37
  101 ENDDO
38
 
39
      END SUBROUTINE
40
 

powered by: WebSVN 2.1.0

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