gcc/fortran/
[official-gcc.git] / gcc / testsuite / gfortran.dg / coarray_lib_this_image_2.f90
blob196a2d3b93e98f86844275a1ddf5b4c2f9558c64
1 ! { dg-do compile }
2 ! { dg-options "-fcoarray=lib -fdump-tree-original" }
5 implicit none
6 real :: x(2)[*]
7 call bar(x)
8 contains
9 subroutine bar(x)
10 integer :: mylcobound, myucobound, mylbound, mythis_image
11 real :: x(:)[5:*]
12 mylcobound = lcobound(x,dim=1)
13 myucobound = ucobound(x,dim=1)
14 mylbound = lbound(x,dim=1)
15 mythis_image = this_image()
16 end subroutine bar
17 end
19 ! { dg-final { scan-tree-dump-times "bar \\(struct array1_real\\(kind=4\\) & restrict x, void \\* restrict caf_token.., integer\\(kind=\[48\]\\) caf_offset..\\)" 1 "original" } }
20 ! { dg-final { scan-tree-dump-times "mylcobound = 5;" 1 "original" } }
21 ! { dg-final { scan-tree-dump-times "parm...dim\\\[1\\\].lbound = 5;" 1 "original" } }
22 ! { dg-final { scan-tree-dump-times "myucobound =\[^\n\r\]* parm...dim\\\[1\\\].lbound \\+ \[^\n\r\]*_gfortran_caf_num_images \\(0, -1\\).? \\+ -?\[0-9\]+\\);" 1 "original" } }
23 ! { dg-final { scan-tree-dump-times "mylbound = 1;" 1 "original" } }
24 ! { dg-final { scan-tree-dump-times "mythis_image = _gfortran_caf_this_image \\(0\\);" 1 "original" } }
25 ! { dg-final { scan-tree-dump-times "bar \\(&parm.\[0-9\]+, caf_token.\[0-9\]+, \\(integer\\(kind=\[48\]\\)\\) parm.\[0-9\]+.data - \\(integer\\(kind=\[48\]\\)\\) x\\);" 1 "original" } }
26 ! { dg-final { scan-tree-dump-times "_gfortran_caf_init \\(&argc, &argv\\);" 1 "original" } }