summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/value_test.f90
blob: 12313324c4de72f965d156a85e39653b7e7e292a (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 run }
program valueTests
  integer :: myInt
  interface
     subroutine mySub(myInt)
       integer, value :: myInt
     end subroutine mySub
  end interface

  myInt = 10

  call mySub(myInt)
  ! myInt should be unchanged since pass-by-value
  if(myInt .ne. 10) then
     call abort ()
  endif
end program valueTests

subroutine mySub(myInt)
  integer, value :: myInt
  myInt = 11
end subroutine mySub