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_3.f03] - Blame information for rev 708

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
module bind_c_dts_3
3
use, intrinsic :: iso_c_binding
4
implicit none
5
 
6
TYPE, bind(c) :: t
7
  integer(c_int) :: i
8
end type t
9
 
10
type :: my_c_type_0 ! { dg-error "must have the BIND attribute" }
11
   integer(c_int) :: i
12
end type my_c_type_0
13
 
14
type, bind(c) :: my_c_type_1 ! { dg-error "BIND.C. derived type" }
15
   type(my_c_type_0) :: my_nested_type
16
   type(c_ptr) :: c_address
17
   integer(c_int), pointer :: j ! { dg-error "cannot have the POINTER" }
18
end type my_c_type_1
19
 
20
type, bind(c) :: t2 ! { dg-error "BIND.C. derived type" }
21
   type (t2), pointer :: next ! { dg-error "cannot have the POINTER" }
22
end type t2
23
 
24
type, bind(c):: t3 ! { dg-error "BIND.C. derived type" }
25
  type(t), allocatable :: c(:) ! { dg-error "cannot have the ALLOCATABLE" }
26
end type t3
27
 
28
contains
29
  subroutine sub0(my_type, expected_value) bind(c)
30
    type(my_c_type_1) :: my_type
31
    integer(c_int), value :: expected_value
32
 
33
    if (my_type%my_nested_type%i .ne. expected_value) then
34
       call abort ()
35
    end if
36
  end subroutine sub0
37
end module bind_c_dts_3
38
 
39
! { dg-final { cleanup-modules "bind_c_dts_3" } }

powered by: WebSVN 2.1.0

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