Daily bump.
[official-gcc.git] / gcc / testsuite / gfortran.dg / coarray_sync.f90
blobf3d6be12779a9556f4e735be889ca64948084956
1 ! { dg-do compile }
2 ! { dg-options "-fcoarray=lib" }
3 ! PR fortran/99351 - ICE in gfc_finish_var_decl, at fortran/trans-decl.c:695
5 module m
6 character(3), parameter :: c = 'abc'
7 integer, parameter :: s = 42
8 integer, target :: i
9 character(:), allocatable :: a
10 target :: a
11 contains
12 subroutine s1
13 allocate (character(42) :: a)
14 sync all (stat=i)
15 sync all (stat=f())
16 sync all (errmsg=a)
17 sync all (errmsg=p())
18 sync all (stat=a%len) ! { dg-error "variable definition context" }
19 sync all (stat=s) ! { dg-error "variable definition context" }
20 sync all (errmsg=c) ! { dg-error "variable definition context" }
21 end
22 subroutine s2
23 sync images (*, stat=i)
24 sync images (*, errmsg=a)
25 sync images (*, stat=a%len) ! { dg-error "variable definition context" }
26 sync images (*, stat=s) ! { dg-error "variable definition context" }
27 sync images (*, errmsg=c) ! { dg-error "variable definition context" }
28 end
29 subroutine s3
30 sync memory (stat=i,errmsg=p())
31 sync memory (stat=f(),errmsg=a)
32 sync memory (stat=a%len) ! { dg-error "variable definition context" }
33 sync memory (stat=s) ! { dg-error "variable definition context" }
34 sync memory (errmsg=c) ! { dg-error "variable definition context" }
35 end
36 integer function f()
37 pointer :: f
38 f => i
39 end function f
40 function p()
41 character(:), pointer :: p
42 p => a
43 end function p
44 end