aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/value_6.f03
blob: 844960fe0e74612d93fe9b81c5c4cc14e1faea3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
! { dg-do run }
! Verify by-value passing of character arguments w/in Fortran to a bind(c) 
! procedure.  
! PR fortran/32732
module pr32732
  use, intrinsic :: iso_c_binding, only: c_char
  implicit none
contains
  subroutine test(a) bind(c)
    character(kind=c_char), value :: a
    call test2(a)
  end subroutine test
  subroutine test2(a) bind(c)
    character(kind=c_char), value :: a
    if(a /= c_char_'a') call abort ()
    print *, 'a=',a
  end subroutine test2
end module pr32732

program main
  use pr32732
  implicit none
  call test('a')
end program main