diff gcc/testsuite/gfortran.dg/bind_c_usage_11.f03 @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/gfortran.dg/bind_c_usage_11.f03	Fri Oct 27 22:46:09 2017 +0900
@@ -0,0 +1,50 @@
+! { dg-do compile }
+! { dg-options "-std=gnu" }
+! PR fortran/34133
+!
+! The compiler should accept internal procedures with BIND(c) attribute
+! for STD GNU / Fortran 2008.
+!
+subroutine foo() bind(c)
+contains
+  subroutine bar() bind (c)
+  end subroutine bar
+end subroutine foo
+
+subroutine foo2() bind(c)
+  use iso_c_binding
+contains
+  integer(c_int) function barbar() bind (c)
+    barbar = 1
+  end function barbar
+end subroutine foo2
+
+function one() bind(c)
+  use iso_c_binding
+  integer(c_int) :: one
+  one = 1
+contains
+  integer(c_int) function two() bind (c)
+    two = 1
+  end function two
+end function one
+
+function one2() bind(c)
+  use iso_c_binding
+  integer(c_int) :: one2
+  one2 = 1
+contains
+  subroutine three() bind (c)
+  end subroutine three
+end function one2
+
+program main
+  use iso_c_binding
+  implicit none
+contains
+  subroutine test() bind(c)
+  end subroutine test
+  integer(c_int) function test2() bind (c)
+    test2 = 1
+  end function test2
+end program main