summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/bind_c_usage_19.f90
blob: 30f9f5ee1fee3f9e94cf067700816f445a1c9477 (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
25
26
27
28
29
30
31
! { dg-do compile }
function return_char1(i) bind(c,name='return_char1')
  use iso_c_binding
  implicit none
  integer(c_int) :: i
  character(c_char) :: j
  character(c_char) :: return_char1

  j = achar(i)
  return_char1 = j
end function return_char1
function return_char2(i) result(output) bind(c,name='return_char2')
  use iso_c_binding
  implicit none
  integer(c_int) :: i
  character(c_char) :: j
  character(c_char) :: output

  j = achar(i)
  output = j
end function return_char2
function return_char3(i) bind(c,name='return_char3') result(output)
  use iso_c_binding
  implicit none
  integer(c_int) :: i
  character(c_char) :: j
  character(c_char) :: output

  j = achar(i)
  output = j
end function return_char3