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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [assign_func_dtcomp_1.f90] - Blame information for rev 853

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

Line No. Rev Author Line
1 149 jeremybenn
! { dg-do run }
2
! { dg-options "-O0" }
3
!
4
! Test fix for PR18022.
5
!
6
! Contributed by Paul Thomas 
7
!
8
program assign_func_dtcomp
9
 implicit none
10
 type                         ::  mytype
11
   real                       ::  x
12
   real                       ::  y
13
 end type mytype
14
 type (mytype), dimension (4) ::  z
15
 
16
 type                         ::  thytype
17
   real                       ::  x(4)
18
 end type thytype
19
 type (thytype)               ::  w
20
 real, dimension (4)          ::  a = (/1.,2.,3.,4./)
21
 real, dimension (4)          ::  b = (/5.,6.,7.,8./)
22
 
23
 
24
! Test the original problem is fixed.
25
 z(:)%x = foo (a)
26
 z(:)%y = foo (b)
27
 
28
 
29
 if (any(z%x.ne.a).or.any(z%y.ne.b)) call abort ()
30
 
31
! Make sure we did not break anything on the way.
32
 w%x(:) = foo (b)
33
 a = foo (b)
34
 
35
 if (any(w%x.ne.b).or.any(a.ne.b)) call abort ()
36
 
37
contains
38
 
39
 function foo (v) result (ans)
40
   real, dimension (:), intent(in)   ::  v
41
   real, dimension (size(v))  ::  ans
42
   ans = v
43
 end function foo
44
 
45
 
46
end program assign_func_dtcomp
47
 

powered by: WebSVN 2.1.0

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