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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
module x
3
  use iso_c_binding
4
  bind(c) :: test, sub1 ! { dg-error "only be used for variables or common blocks" }
5
  bind(c) :: sub2 ! { dg-error "only be used for variables or common blocks" }
6
contains
7
  function foo() bind(c,name="xx")
8
    integer(c_int),bind(c,name="xy") :: foo ! { dg-error "only be used for variables or common blocks" }
9
    ! NAG f95: "BIND(C) for non-variable FOO"
10
    ! g95: "Duplicate BIND attribute specified"
11
    ! gfortran: Accepted
12
    foo = 5_c_int
13
  end function foo
14
 
15
  function test()
16
    integer(c_int) :: test
17
    bind(c,name="kk") :: test ! { dg-error "only be used for variables or common blocks" }
18
    ! NAG f95: "BIND(C) for non-variable TEST"
19
    ! gfortran, g95: Accepted
20
    test = 5_c_int
21
  end function test
22
 
23
  function bar() bind(c)
24
    integer(c_int) :: bar
25
    bind(c,name="zx") :: bar ! { dg-error "only be used for variables or common blocks" }
26
    bar = 5_c_int
27
  end function bar
28
 
29
  subroutine sub0() bind(c)
30
    bind(c) :: sub0 ! { dg-error "only be used for variables or common blocks" }
31
  end subroutine sub0
32
 
33
  subroutine sub1(i) bind(c)
34
    use, intrinsic :: iso_c_binding, only: c_int
35
    integer(c_int), value :: i
36
  end subroutine sub1
37
 
38
  subroutine sub2(i)
39
    use, intrinsic :: iso_c_binding, only: c_int
40
    integer(c_int), value :: i
41
  end subroutine sub2
42
 
43
  subroutine sub3(i)
44
    use, intrinsic :: iso_c_binding, only: c_int
45
    integer(c_int), value :: i
46
    bind(c) :: sub3 ! { dg-error "only be used for variables or common blocks" }
47
  end subroutine sub3
48
end module x

powered by: WebSVN 2.1.0

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