OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [c_char_tests.f03] - Blame information for rev 694

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! { dg-additional-sources c_char_driver.c }
3
! Verify that character dummy arguments for bind(c) procedures can work both
4
! by-value and by-reference when called by either C or Fortran.
5
! PR fortran/32732
6
module c_char_tests
7
  use, intrinsic :: iso_c_binding, only: c_char
8
  implicit none
9
contains
10
  subroutine param_test(my_char, my_char_2) bind(c)
11
    character(c_char), value :: my_char
12
    character(c_char), value :: my_char_2
13
    if(my_char /= c_char_'y') call abort()
14
    if(my_char_2 /= c_char_'z') call abort()
15
 
16
    call sub1(my_char)
17
  end subroutine param_test
18
 
19
  subroutine sub0() bind(c)
20
    call param_test('y', 'z')
21
  end subroutine sub0
22
 
23
  subroutine sub1(my_char_ref) bind(c)
24
    character(c_char) :: my_char_ref
25
    if(my_char_ref /= c_char_'y') call abort()
26
  end subroutine sub1
27
end module c_char_tests
28
 
29
! { dg-final { cleanup-modules "c_char_tests" } }

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.