re PR fortran/85448 (Report binding label clash with a global identifyer)
2019-04-14 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/85448 * gfortran.dg/bind_c_usage_33.f90: New test and... * gfortran.dg/bind_c_usage_33_c.c: Additional source. From-SVN: r270354
This commit is contained in:
parent
0d78e4aa06
commit
ceae614e1d
@ -1,3 +1,9 @@
|
||||
2019-04-14 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||
|
||||
PR fortran/85448
|
||||
* gfortran.dg/bind_c_usage_33.f90: New test and...
|
||||
* gfortran.dg/bind_c_usage_33_c.c: Additional source.
|
||||
|
||||
2019-04-14 Paul Thomas <pault@gcc.gnu.org>
|
||||
|
||||
PR fortran/89843
|
||||
|
21
gcc/testsuite/gfortran.dg/bind_c_usage_33.f90
Normal file
21
gcc/testsuite/gfortran.dg/bind_c_usage_33.f90
Normal file
@ -0,0 +1,21 @@
|
||||
! { dg-do run }
|
||||
! { dg-additional-sources bind_c_usage_33_c.c }
|
||||
module m1
|
||||
implicit none
|
||||
contains
|
||||
subroutine odopen(unit)
|
||||
integer,intent(out) :: unit
|
||||
unit=8
|
||||
end subroutine
|
||||
end module
|
||||
|
||||
module m2
|
||||
use iso_c_binding
|
||||
use m1
|
||||
implicit none
|
||||
contains
|
||||
subroutine c_odopen(unit) bind(c,name="odopen")
|
||||
integer(c_int),intent(out) :: unit
|
||||
call odopen(unit)
|
||||
end subroutine
|
||||
end module
|
15
gcc/testsuite/gfortran.dg/bind_c_usage_33_c.c
Normal file
15
gcc/testsuite/gfortran.dg/bind_c_usage_33_c.c
Normal file
@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void odopen(int*);
|
||||
|
||||
int main()
|
||||
{
|
||||
int unit = 42;
|
||||
odopen(&unit);
|
||||
if (unit != 8)
|
||||
{
|
||||
fprintf(stderr,"wrong result");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user