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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [coarray/] [this_image_1.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 fortran/18918
4
!
5
! this_image(coarray) run test,
6
! expecially for num_images > 1
7
!
8
! Tested are values up to num_images == 8,
9
! higher values are OK, but not tested for
10
!
11
implicit none
12
integer :: a(1)[2:2, 3:4, 7:*]
13
integer :: b(:)[:, :,:]
14
allocatable :: b
15
integer :: i
16
 
17
if (this_image(A, dim=1) /= 2) call abort()
18
i = 1
19
if (this_image(A, dim=i) /= 2) call abort()
20
 
21
select case (this_image())
22
  case (1)
23
    if (this_image(A, dim=2) /= 3) call abort()
24
    if (this_image(A, dim=3) /= 7) call abort()
25
    i = 2
26
    if (this_image(A, dim=i) /= 3) call abort()
27
    i = 3
28
    if (this_image(A, dim=i) /= 7) call abort()
29
    if (any (this_image(A) /= [2,3,7])) call abort()
30
 
31
  case (2)
32
    if (this_image(A, dim=2) /= 4) call abort()
33
    if (this_image(A, dim=3) /= 7) call abort()
34
    i = 2
35
    if (this_image(A, dim=i) /= 4) call abort()
36
    i = 3
37
    if (this_image(A, dim=i) /= 7) call abort()
38
    if (any (this_image(A) /= [2,4,7])) call abort()
39
 
40
  case (3)
41
    if (this_image(A, dim=2) /= 3) call abort()
42
    if (this_image(A, dim=3) /= 8) call abort()
43
    i = 2
44
    if (this_image(A, dim=i) /= 3) call abort()
45
    i = 3
46
    if (this_image(A, dim=i) /= 8) call abort()
47
    if (any (this_image(A) /= [2,3,8])) call abort()
48
 
49
  case (4)
50
    if (this_image(A, dim=2) /= 4) call abort()
51
    if (this_image(A, dim=3) /= 8) call abort()
52
    i = 2
53
    if (this_image(A, dim=i) /= 4) call abort()
54
    i = 3
55
    if (this_image(A, dim=i) /= 8) call abort()
56
    if (any (this_image(A) /= [2,4,8])) call abort()
57
 
58
  case (5)
59
    if (this_image(A, dim=2) /= 3) call abort()
60
    if (this_image(A, dim=3) /= 9) call abort()
61
    i = 2
62
    if (this_image(A, dim=i) /= 3) call abort()
63
    i = 3
64
    if (this_image(A, dim=i) /= 9) call abort()
65
    if (any (this_image(A) /= [2,3,9])) call abort()
66
 
67
  case (6)
68
    if (this_image(A, dim=2) /= 4) call abort()
69
    if (this_image(A, dim=3) /= 9) call abort()
70
    i = 2
71
    if (this_image(A, dim=i) /= 4) call abort()
72
    i = 3
73
    if (this_image(A, dim=i) /= 9) call abort()
74
    if (any (this_image(A) /= [2,4,9])) call abort()
75
 
76
  case (7)
77
    if (this_image(A, dim=2) /= 3) call abort()
78
    if (this_image(A, dim=3) /= 10) call abort()
79
    i = 2
80
    if (this_image(A, dim=i) /= 3) call abort()
81
    i = 3
82
    if (this_image(A, dim=i) /= 10) call abort()
83
    if (any (this_image(A) /= [2,3,10])) call abort()
84
 
85
  case (8)
86
    if (this_image(A, dim=2) /= 4) call abort()
87
    if (this_image(A, dim=3) /= 10) call abort()
88
    i = 2
89
    if (this_image(A, dim=i) /= 4) call abort()
90
    i = 3
91
    if (this_image(A, dim=i) /= 10) call abort()
92
    if (any (this_image(A) /= [2,4,10])) call abort()
93
end select
94
 
95
 
96
allocate (b(3)[-1:0,2:4,*])
97
 
98
select case (this_image())
99
  case (1)
100
    if (this_image(B, dim=1) /= -1) call abort()
101
    if (this_image(B, dim=2) /= 2) call abort()
102
    if (this_image(B, dim=3) /= 1) call abort()
103
    i = 1
104
    if (this_image(B, dim=i) /= -1) call abort()
105
    i = 2
106
    if (this_image(B, dim=i) /= 2) call abort()
107
    i = 3
108
    if (this_image(B, dim=i) /= 1) call abort()
109
    if (any (this_image(B) /= [-1,2,1])) call abort()
110
 
111
  case (2)
112
    if (this_image(B, dim=1) /= 0) call abort()
113
    if (this_image(B, dim=2) /= 2) call abort()
114
    if (this_image(B, dim=3) /= 1) call abort()
115
    i = 1
116
    if (this_image(B, dim=i) /= 0) call abort()
117
    i = 2
118
    if (this_image(B, dim=i) /= 2) call abort()
119
    i = 3
120
    if (this_image(B, dim=i) /= 1) call abort()
121
    if (any (this_image(B) /= [0,2,1])) call abort()
122
 
123
  case (3)
124
    if (this_image(B, dim=1) /= -1) call abort()
125
    if (this_image(B, dim=2) /= 3) call abort()
126
    if (this_image(B, dim=3) /= 1) call abort()
127
    i = 1
128
    if (this_image(B, dim=i) /= -1) call abort()
129
    i = 2
130
    if (this_image(B, dim=i) /= 3) call abort()
131
    i = 3
132
    if (this_image(B, dim=i) /= 1) call abort()
133
    if (any (this_image(B) /= [-1,3,1])) call abort()
134
 
135
  case (4)
136
    if (this_image(B, dim=1) /= 0) call abort()
137
    if (this_image(B, dim=2) /= 3) call abort()
138
    if (this_image(B, dim=3) /= 1) call abort()
139
    i = 1
140
    if (this_image(B, dim=i) /= 0) call abort()
141
    i = 2
142
    if (this_image(B, dim=i) /= 3) call abort()
143
    i = 3
144
    if (this_image(B, dim=i) /= 1) call abort()
145
    if (any (this_image(B) /= [0,3,1])) call abort()
146
 
147
  case (5)
148
    if (this_image(B, dim=1) /= -1) call abort()
149
    if (this_image(B, dim=2) /= 4) call abort()
150
    if (this_image(B, dim=3) /= 1) call abort()
151
    i = 1
152
    if (this_image(B, dim=i) /= -1) call abort()
153
    i = 2
154
    if (this_image(B, dim=i) /= 4) call abort()
155
    i = 3
156
    if (this_image(B, dim=i) /= 1) call abort()
157
    if (any (this_image(B) /= [-1,4,1])) call abort()
158
 
159
  case (6)
160
    if (this_image(B, dim=1) /= 0) call abort()
161
    if (this_image(B, dim=2) /= 4) call abort()
162
    if (this_image(B, dim=3) /= 1) call abort()
163
    i = 1
164
    if (this_image(B, dim=i) /= 0) call abort()
165
    i = 2
166
    if (this_image(B, dim=i) /= 4) call abort()
167
    i = 3
168
    if (this_image(B, dim=i) /= 1) call abort()
169
    if (any (this_image(B) /= [0,4,1])) call abort()
170
 
171
  case (7)
172
    if (this_image(B, dim=1) /= -1) call abort()
173
    if (this_image(B, dim=2) /= 2) call abort()
174
    if (this_image(B, dim=3) /= 2) call abort()
175
    i = 1
176
    if (this_image(B, dim=i) /= -1) call abort()
177
    i = 2
178
    if (this_image(B, dim=i) /= 2) call abort()
179
    i = 3
180
    if (this_image(B, dim=i) /= 2) call abort()
181
    if (any (this_image(B) /= [-1,2,2])) call abort()
182
 
183
  case (8)
184
    if (this_image(B, dim=1) /= 0) call abort()
185
    if (this_image(B, dim=2) /= 2) call abort()
186
    if (this_image(B, dim=3) /= 2) call abort()
187
    i = 1
188
    if (this_image(B, dim=i) /= 0) call abort()
189
    i = 2
190
    if (this_image(B, dim=i) /= 2) call abort()
191
    i = 3
192
    if (this_image(B, dim=i) /= 2) call abort()
193
    if (any (this_image(B) /= [0,2,2])) call abort()
194
end select
195
 
196
end

powered by: WebSVN 2.1.0

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