aarch64: Add missing ACLE macro for NEON-SVE Bridge
[official-gcc.git] / gcc / testsuite / gfortran.dg / pr95398.f90
blob7576f3844b2b70df9a4255882df47cc30f7f2248
1 ! { dg-do compile }
3 ! { dg-options "-std=f2008" }
5 program test
6 implicit none
8 type :: t1
9 integer :: i
10 end type
12 type, extends(t1) :: t2
13 end type
15 class(t1), allocatable :: array1(:,:)
16 class(t2), allocatable :: array2(:,:)
18 allocate(array1(3,3))
19 allocate(array2(3,3))
21 select type(b => foo(1))
22 type is (t1)
23 b%i = 1
24 type is (t2)
25 call sub_with_in_and_inout_param(b,b)
26 end select
28 contains
30 function foo(i)
31 integer :: U(2)
32 integer :: i
33 class(t1), POINTER :: foo(:)
34 ALLOCATE(foo(2))
35 U = [ 1,2 ]
36 if (i>0) then
37 foo => array1(2,U)
38 else
39 foo => array2(2,U)
40 end if
41 end function
43 subroutine sub_with_in_and_inout_param(y, z)
44 type(t2), INTENT(IN) :: y(:)
45 class(t2), INTENT(INOUT) :: z(:)
46 z%i = 10
47 end subroutine
49 end
51 ! { dg-error "being used in a variable definition context .assignment." " " { target *-*-* } 23 }
52 ! { dg-error "being used in a variable definition context .actual argument to INTENT = OUT.INOUT." " " { target *-*-* } 25 }
53 ! { dg-error "Pointer assignment target is neither TARGET nor POINTER" " " { target *-*-* } 37 }
54 ! { dg-error "Pointer assignment target is neither TARGET nor POINTER" " " { target *-*-* } 39 }