aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/elemental_by_value_1.f90
blob: 4fc59471b5b5e0a0950275c4f2b08596fcdf434f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
! { dg-do run }
!
! PR fortran/59026
!
! Contributed by F-X Coudert  <fxcoudert@gcc.gnu.org>
!
! Failed to dereference the argument in scalarized loop.
!
elemental integer function foo(x)
  integer, value :: x
  foo = x + 1
end function

  interface
    elemental integer function foo(x)
    integer, value :: x
    end function
  end interface

  if (foo(42) .ne. 43) call abort
  if (any (foo([0,1]) .ne. [1,2])) call abort
end