OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gfortran.dg/] [bind_c_vars.f90] - Blame information for rev 384

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do run }
2
! { dg-additional-sources bind_c_vars_driver.c }
3
module bind_c_vars
4
  use, intrinsic :: iso_c_binding
5
  implicit none
6
 
7
  integer(c_int), bind(c) :: myF90Int
8
  real(c_float), bind(c, name="myF90Real") :: f90_real
9
  integer(c_int) :: c2
10
  integer(c_int) :: c3
11
  integer(c_int) :: c4
12
  bind(c, name="myVariable") :: c2
13
  bind(c) c3, c4
14
 
15
  integer(c_int), bind(c, name="myF90Array3D") :: A(18, 3:7, 10)
16
  integer(c_int), bind(c, name="myF90Array2D") :: B(3, 2)
17
 
18
contains
19
 
20
  subroutine changeF90Globals() bind(c, name='changeF90Globals')
21
    implicit none
22
    ! should make it 2
23
    myF90Int = myF90Int + 1
24
    ! should make it 3.0
25
    f90_real = f90_real * 3.0;
26
    ! should make it 4
27
    c2 = c2 * 2;
28
    ! should make it 6
29
    c3 = c3 + 3;
30
    ! should make it 2
31
    c4 = c4 / 2;
32
    ! should make it 2
33
    A(5, 6, 3) = A(5, 6, 3) + 1
34
    ! should make it 3
35
    B(3, 2) = B(3, 2) + 1
36
  end subroutine changeF90Globals
37
 
38
end module bind_c_vars
39
 
40
! { dg-final { cleanup-modules "bind_c_vars" } }

powered by: WebSVN 2.1.0

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