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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [coarray/] [scalar_alloc_2.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
! Check whether registering allocatable coarrays works
4
!
5
type position
6
  real :: x, y, z
7
end type position
8
 
9
integer, allocatable :: a[:]
10
type(position), allocatable :: p[:]
11
 
12
allocate(a[*])
13
a = 7
14
 
15
allocate(p[*])
16
p%x = 11
17
p%y = 13
18
p%z = 15
19
 
20
if (a /= 7) call abort()
21
a = 88
22
if (a /= 88) call abort()
23
 
24
if (p%x /= 11) call abort()
25
p%x = 17
26
if (p%x /= 17) call abort()
27
 
28
 block
29
   integer, allocatable :: b[:]
30
 
31
   allocate(b[*])
32
   b = 8494
33
 
34
   if (b /= 8494) call abort()
35
 end block
36
 
37
if (a /= 88) call abort()
38
call test ()
39
end
40
 
41
subroutine test()
42
  type velocity
43
    real :: x, y, z
44
  end type velocity
45
 
46
  real, allocatable :: z[:]
47
  type(velocity), allocatable :: v[:]
48
 
49
  allocate(z[*])
50
  z = sqrt(2.0)
51
 
52
  allocate(v[*])
53
  v%x = 21
54
  v%y = 23
55
  v%z = 25
56
 
57
  if (z /= sqrt(2.0)) call abort()
58
  if (v%x /= 21) call abort()
59
 
60
end subroutine test

powered by: WebSVN 2.1.0

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