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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! { dg-options "-fcray-pointer" }
3
 
4
! Test the fix for a runtime error
5
! Contributed by Mike Kumbera 
6
 
7
        program bob
8
        implicit none
9
        integer*8 ipfoo
10
        integer n,m,i,j
11
        real*8 foo
12
 
13
        common /ipdata/ ipfoo
14
        common /ipsize/ n,m
15
        POINTER ( ipfoo, foo(3,7) )
16
 
17
        n=3
18
        m=7
19
 
20
        ipfoo=malloc(8*n*m)
21
        do i=1,n
22
            do j=1,m
23
                foo(i,j)=1.d0
24
            end do
25
        end do
26
        call use_foo()
27
        end  program bob
28
 
29
 
30
        subroutine use_foo()
31
        implicit none
32
        integer n,m,i,j
33
        integer*8 ipfoo
34
        common /ipdata/ ipfoo
35
        common /ipsize/ n,m
36
        real*8 foo,boo
37
 
38
        !fails if * is the last dimension
39
        POINTER ( ipfoo, foo(n,*) )
40
 
41
        !works if the last dimension is specified
42
        !POINTER ( ipfoo, foo(n,m) )
43
        boo=0.d0
44
        do i=1,n
45
            do j=1,m
46
               boo=foo(i,j)+1.0
47
               if (abs (boo - 2.0) .gt. 1e-6) call abort
48
            end do
49
        end do
50
 
51
        end subroutine use_foo

powered by: WebSVN 2.1.0

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