2 ! { dg-options "-std=f2003 -fdump-tree-original" }
4 ! Covers code introduced by the fix to PR fortran/87923.
5 ! The idea is that the variables in a namelist or I/O list used for
6 ! asynchronous I/O will be marked with the asynchronous attribute.
8 ! At this time, "asynchronous" is treated as "volatile" (see trans-decl.c).
9 ! Thus, every variable referenced in an "asynchronous=yes" I/O list
10 ! should obtain the "volatile" specifier in its declaration.
16 character(4) :: comp_async
23 integer :: ivar_noasync
25 namelist /names/ ivar_async, rvar_async, lvar_async
27 open(1, asynchronous="yes")
28 write(1, asynchronous="yes") dvar_async
29 write(1, asynchronous="yes") dvar_async%comp_async
30 read(1, asynchronous="yes", nml=names)
32 open(2, asynchronous="no")
33 read(2, asynchronous="no") ivar_noasync
37 ! { dg-final { scan-tree-dump "volatile +struct +\[^ \]+ +dvar_async" "original" } }
38 ! { dg-final { scan-tree-dump "volatile +\[^ \]+ +ivar_async" "original" } }
39 ! { dg-final { scan-tree-dump "volatile +\[^ \]+ +rvar_async" "original" } }
40 ! { dg-final { scan-tree-dump "volatile +\[^ \]+ +lvar_async" "original" } }
41 ! { dg-final { scan-tree-dump-not "volatile +\[^ \]+ +ivar_noasync" "original" } }