arm: Add .type and .size to __gnu_cmse_nonsecure_call [PR115360]
[official-gcc.git] / gcc / testsuite / gfortran.dg / associate_51.f90
blob2e5218c78cf16c53fd17b1da4246c3dc94e6e9ba
1 ! { dg-do compile }
3 ! PR fortran/92994
5 ! Contributed by G. Steinmetz
7 recursive function f() result(z)
8 associate (y1 => f())
9 end associate
10 associate (y2 => f) ! { dg-error "is a procedure name" }
11 end associate
12 end
14 recursive function f2()
15 associate (y1 => f2()) ! { dg-error "Invalid association target" }
16 end associate ! { dg-error "Expecting END FUNCTION statement" }
17 end
19 recursive function f3()
20 associate (y1 => f3)
21 print *, y1() ! { dg-error "Expected array subscript" }
22 end associate
23 associate (y2 => f3) ! { dg-error "Associate-name 'y2' at \\(1\\) is used as array" }
24 print *, y2(1)
25 end associate
26 end
28 subroutine p2
29 type t
30 end type
31 type(t) :: z = t()
32 associate (y => t())
33 end associate
34 end
36 subroutine p3
37 procedure() :: g
38 associate (y => g) ! { dg-error "is a procedure name" }
39 end associate
40 end
42 subroutine p4
43 external :: g
44 associate (y => g) ! { dg-error "is a procedure name" }
45 end associate
46 end
48 recursive subroutine s
49 associate (y => s) ! { dg-error "is a procedure name" }
50 end associate
51 end
53 recursive subroutine s2
54 associate (y => (s2)) ! { dg-error "is a procedure name" }
55 end associate
56 end
58 program p
59 associate (y => (p)) ! { dg-error "Invalid association target" }
60 end associate ! { dg-error "Expecting END PROGRAM statement" }
61 end