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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [der_init.f90] - Blame information for rev 303

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 303 jeremybenn
! Program to test derived type initializers and constructors
2
program der_init
3
   implicit none
4
   type t
5
      integer :: i
6
      integer :: j = 4
7
   end type
8
   integer :: m, n
9
 
10
   ! Explicit initializer
11
   type (t) :: var = t(1, 2)
12
   ! Type (default) initializer
13
   type (t) :: var2
14
   ! Initialization of arrays
15
   type (t), dimension(2) :: var3
16
   type (t), dimension(2) :: var4 = (/t(7, 9), t(8, 6)/)
17
 
18
   if (var%i .ne. 1 .or. var%j .ne. 2) call abort
19
   if (var2%j .ne. 4) call abort
20
   var2 = t(6, 5)
21
   if (var2%i .ne. 6 .or. var2%j .ne. 5) call abort
22
 
23
   if ((var3(1)%j .ne. 4) .or. (var3(2)%j .ne. 4)) call abort
24
   if ((var4(1)%i .ne. 7) .or. (var4(2)%i .ne. 8) &
25
       .or. (var4(1)%j .ne. 9) .or. (var4(2)%j .ne. 6)) call abort
26
 
27
   ! Non-constant constructor
28
   n = 1
29
   m = 5
30
   var2 = t(n, n + m)
31
   if (var2%i .ne. 1 .or. var2%j .ne. 6) call abort
32
end program

powered by: WebSVN 2.1.0

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