aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr91649.f90
blob: 0e6acb9ac8d3c317438f3bdd39210038a52112d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
! { dg-do compile }
! PR fortran/91649
! Code originally contributed by Gerhard Steinmetz
subroutine p
   logical :: back = .true.
   integer :: x(1) = findloc([1, 2, 1], '1', back=back) ! { dg-error "must be in type conformance" }
   print *, x
end

subroutine q
   type t
   end type
   logical :: back = .false.
   integer :: x(1) = findloc([1, 2, 1], t(), back=back) ! { dg-error "must be of intrinsic type" }
   print *, x
end

subroutine s
   character(4) :: c = '1234'
   integer :: x(1) = findloc([1, 2, 1], c, back=.true.) ! { dg-error "must be in type conformance" }
   print *, x
end