re PR fortran/42651 (Functions with result: Wrongly accepts attributes to function...
[gcc.git] / gcc / testsuite / gfortran.dg / pr42651.f90
1 ! { dg-do compile }
2 ! PR fortran/42651
3 integer function func()
4 asynchronous :: func
5 integer, asynchronous:: b
6 allocatable :: c
7 volatile :: func
8 type t
9 sequence
10 integer :: i = 5
11 end type t
12 end function func
13
14 function func2() result(res) ! { dg-error " RESULT variable" }
15 volatile res
16 asynchronous res
17 target func2 ! { dg-error " RESULT variable" }
18 volatile func2 ! { dg-error " RESULT variable" }
19 asynchronous func2 ! { dg-error " RESULT variable" }
20 allocatable func2 ! { dg-error " RESULT variable" }
21 dimension func2(2) ! { dg-error " RESULT variable" }
22 codimension func2[*] ! { dg-error " RESULT variable" }
23 contiguous func2 ! { dg-error " RESULT variable" }
24 end function func2