Debian Codegraph @

gcc/testsuite/gfortran.dg/value_6.f03

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