2 ! { dg-options "-fdump-tree-original -fcoarray=lib -lcaf_single" }
3 ! { dg-additional-options "-latomic" { target libatomic_available } }
5 ! Some dependency-analysis check for coarray communication
7 integer, target
, save :: A(10)[*]
8 integer, pointer :: P(:)
9 integer, save :: B(10)[*]
11 A
= [1,2,3,4,5,6,7,8,9,10]
12 B
= [1,2,3,4,5,6,7,8,9,10]
13 A(10:2:-1) = A(9:1:-1)[1] ! 0
14 B(10:2:-1) = B(9:1:-1)
15 if (any (A
-B
/= 0)) STOP 1
17 A
= [1,2,3,4,5,6,7,8,9,10]
18 B
= [1,2,3,4,5,6,7,8,9,10]
19 A(9:1:-1) = A(10:2:-1)[1] ! 1
20 B(9:1:-1) = B(10:2:-1)
21 if (any (A
-B
/= 0)) STOP 2
23 A
= [1,2,3,4,5,6,7,8,9,10]
24 B
= [1,2,3,4,5,6,7,8,9,10]
27 if (any (A
-B
/= 0)) STOP 3
29 A
= [1,2,3,4,5,6,7,8,9,10]
30 B
= [1,2,3,4,5,6,7,8,9,10]
34 A
= [1,2,3,4,5,6,7,8,9,10]
35 B
= [1,2,3,4,5,6,7,8,9,10]
36 A(1:5)[1] = A(3:7)[1] ! 1
38 if (any (A
-B
/= 0)) STOP 4
41 ! { dg-final { scan-tree-dump-times "_gfortran_caf_get \\\(caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, &parm.\[0-9\]+, 4, 4, 1, 0B\\\);" 3 "original" } }
42 ! { dg-final { scan-tree-dump-times "_gfortran_caf_get \\\(caf_token.1, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) b, 1, &parm.\[0-9\]+, 0B, &parm.\[0-9\]+, 4, 4, 0, 0B\\\);" 1 "original" } }
43 ! { dg-final { scan-tree-dump-times "_gfortran_caf_sendget \\\(caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, caf_token.0, \\\(integer\\\(kind=\[48\]\\\)\\\) parm.\[0-9\]+.data - \\\(integer\\\(kind=\[48\]\\\)\\\) a, 1, &parm.\[0-9\]+, 0B, 4, 4, 1, 0B\\\);" 1 "original" } }