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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
!
3
! PR 45290: [F08] pointer initialization
4
!
5
! Contributed by Janus Weil 
6
 
7
module m
8
 integer, target  :: t1          ! SAVE is implicit
9
 integer, pointer :: p1 => t1
10
end module m
11
 
12
 
13
use m
14
implicit none
15
 
16
integer,target :: i0 = 2
17
integer,target,dimension(1:3) :: vec = 1
18
 
19
type :: t
20
  integer, pointer :: dpc => i0
21
  integer :: i = 0
22
end type
23
 
24
type (t), save, target :: u
25
 
26
integer, pointer :: dp => i0
27
integer, pointer :: dp2 => vec(2)
28
integer, pointer :: dp3 => u%i
29
 
30
dp = 5
31
if (i0/=5) call abort()
32
 
33
u%dpc = 6
34
if (i0/=6) call abort()
35
 
36
dp2 = 3
37
if (vec(2)/=3) call abort()
38
 
39
dp3 = 4
40
if (u%i/=4) call abort()
41
 
42
end
43
 
44
! { dg-final { cleanup-modules "m" } }

powered by: WebSVN 2.1.0

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