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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [bind_c_dts.f90] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! { dg-additional-sources bind_c_dts_driver.c }
3
module bind_c_dts
4
  use, intrinsic :: iso_c_binding
5
  implicit none
6
 
7
  type, bind(c) :: MYFTYPE_1
8
     integer(c_int) :: i, j
9
     real(c_float) :: s
10
  end type MYFTYPE_1
11
 
12
  TYPE, BIND(C) :: particle
13
     REAL(C_DOUBLE) :: x,vx
14
     REAL(C_DOUBLE) :: y,vy
15
     REAL(C_DOUBLE) :: z,vz
16
     REAL(C_DOUBLE) :: m
17
  END TYPE particle
18
 
19
  type(myftype_1), bind(c, name="myDerived") :: myDerived
20
 
21
contains
22
  subroutine types_test(my_particles, num_particles) bind(c)
23
    integer(c_int), value :: num_particles
24
    type(particle), dimension(num_particles) :: my_particles
25
    integer :: i
26
 
27
    ! going to set the particle in the middle of the list
28
    i = num_particles / 2;
29
    my_particles(i)%x = my_particles(i)%x + .2d0
30
    my_particles(i)%vx = my_particles(i)%vx + .2d0
31
    my_particles(i)%y = my_particles(i)%y + .2d0
32
    my_particles(i)%vy = my_particles(i)%vy + .2d0
33
    my_particles(i)%z = my_particles(i)%z + .2d0
34
    my_particles(i)%vz = my_particles(i)%vz + .2d0
35
    my_particles(i)%m = my_particles(i)%m + .2d0
36
 
37
    myDerived%i = myDerived%i + 1
38
    myDerived%j = myDerived%j + 1
39
    myDerived%s = myDerived%s + 1.0;
40
  end subroutine types_test
41
end module bind_c_dts
42
 
43
! { dg-final { cleanup-modules "bind_c_dts" } }

powered by: WebSVN 2.1.0

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