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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [data.f90] - Blame information for rev 695

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 695 jeremybenn
        ! Program to test data statement
2
        program data
3
        call sub1()
4
        call sub2()
5
        end
6
        subroutine sub1()
7
        integer i
8
        type tmp
9
          integer, dimension(4)::a
10
          real :: r
11
        end type
12
        type tmp1
13
          type (tmp) t1(4)
14
          integer b
15
        end type
16
        type (tmp1) tmp2(2)
17
        ! Full array and scalar component initializer
18
        data tmp2(2)%t1(2)%r, tmp2(1)%t1(3)%a, tmp2(1)%b/220,136,137,138,139,10/
19
        data tmp2(2)%t1(4)%a,tmp2(2)%t1(3)%a/241,242,4*5,233,234/
20
        ! implied DO
21
        data (tmp2(1)%t1(2)%a(i),i=4,1,-1)/124,123,122,121/
22
        ! array section
23
        data tmp2(1)%t1(4)%a(4:1:-1)/144,143,142,141/
24
        data tmp2(1)%t1(1)%a(1:4:2)/111,113/
25
        ! array element reference
26
        data tmp2(2)%t1(2)%a(3), tmp2(2)%t1(2)%a(1)/223,221/
27
 
28
        if (any(tmp2(1)%t1(1)%a .ne. (/111,0,113,0/))) call abort
29
        if (tmp2(1)%t1(1)%r .ne. 0.0) call abort
30
        if (tmp2(1)%b .ne. 10) call abort
31
 
32
        if (any(tmp2(1)%t1(2)%a .ne. (/121,122,123,124/))) call abort
33
        if (tmp2(1)%t1(2)%r .ne. 0.0) call abort
34
        if (tmp2(1)%b .ne. 10) call abort
35
 
36
        if (any(tmp2(1)%t1(3)%a .ne. (/136,137,138,139/))) call abort
37
        if (tmp2(1)%t1(3)%r .ne. 0.0) call abort
38
        if (tmp2(1)%b .ne. 10) call abort
39
 
40
        if (any(tmp2(1)%t1(4)%a .ne. (/141,142,143,144/))) call abort
41
        if (tmp2(1)%t1(4)%r .ne. 0.0) call abort
42
        if (tmp2(1)%b .ne. 10) call abort
43
 
44
        if (any(tmp2(2)%t1(1)%a .ne. (/0,0,0,0/))) call abort
45
        if (tmp2(2)%t1(1)%r .ne. 0.0) call abort
46
        if (tmp2(2)%b .ne. 0) call abort
47
 
48
        if (any(tmp2(2)%t1(2)%a .ne. (/221,0,223,0/))) call abort
49
        if (tmp2(2)%t1(2)%r .ne. 220.0) call abort
50
        if (tmp2(2)%b .ne. 0) call abort
51
 
52
        if (any(tmp2(2)%t1(3)%a .ne. (/5,5,233,234/))) call abort
53
        if (tmp2(2)%t1(3)%r .ne. 0.0) call abort
54
        if (tmp2(2)%b .ne. 0) call abort
55
 
56
        if (any(tmp2(2)%t1(4)%a .ne. (/241,242,5,5/))) call abort
57
        if (tmp2(2)%t1(4)%r .ne. 0.0) call abort
58
        if (tmp2(2)%b .ne. 0) call abort
59
 
60
        end
61
        subroutine sub2()
62
        integer a(4,4), b(10)
63
        integer i,j,k
64
        real r,t
65
        data i,j,r,k,t,b(5),b(2),((a(i,j),i=1,4,1),j=4,1,-1)/1,2,3,4,5,5,2,&
66
             1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16/
67
        if ((i.ne.1) .and. (j.ne.2).and.(k.ne.4)) call abort
68
        if ((r.ne.3.0).and.(t.ne.5.0))  call abort
69
        if (any(b.ne.(/0,2,0,0,5,0,0,0,0,0/))) call abort
70
        if (any(a.ne.reshape((/13,14,15,16,9,10,11,12,5,6,7,8,1,2,3,4/),(/4,4/)))) call abort
71
        end
72
 

powered by: WebSVN 2.1.0

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