File: do_concurrent_2.f90

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (40 lines) | stat: -rw-r--r-- 841 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
! { dg-do run }
!
! PR fortran/44646
!
! DO CONCURRENT
!
implicit none
integer :: i, j
integer :: A(5,5)

A = 0.0
do concurrent (i=1:5, j=1:5, (i/=j))
  if (i == 5) cycle
  A(i,j) = i*j
end do

if (any (A(:,1) /= [0,  2,  3,  4, 0])) STOP 1
if (any (A(:,2) /= [2,  0,  6,  8, 0])) STOP 2
if (any (A(:,3) /= [3,  6,  0, 12, 0])) STOP 3
if (any (A(:,4) /= [4,  8, 12,  0, 0])) STOP 4
if (any (A(:,5) /= [5, 10, 15, 20, 0])) STOP 5

A = -99

do concurrent (i = 1 : 5)
  forall (j=1:4, i/=j)
    A(i,j) = i*j
  end forall
  if (i == 5) then
    A(i,i) = -i
  end if
end do

if (any (A(:,1) /= [-99,   2,   3,   4,  5])) STOP 6
if (any (A(:,2) /= [  2, -99,   6,   8, 10])) STOP 7
if (any (A(:,3) /= [  3,   6, -99,  12, 15])) STOP 8
if (any (A(:,4) /= [  4,   8,  12, -99, 20])) STOP 9
if (any (A(:,5) /= [-99, -99, -99, -99, -5])) STOP 10

end