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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! { dg-options "-fcoarray=single" }
3
! PR 38536 - array sections as arguments to c_loc are illegal.
4
  use iso_c_binding
5
  type, bind(c) :: t1
6
     integer(c_int) :: i(5)
7
  end type t1
8
  type, bind(c):: t2
9
     type(t1) :: t(5)
10
  end type t2
11
  type, bind(c) :: t3
12
     type(t1) :: t(5,5)
13
  end type t3
14
 
15
  type(t2), target :: tt
16
  type(t3), target :: ttt
17
  integer(c_int), target :: n(3)
18
  integer(c_int), target :: x[*]
19
  type(C_PTR) :: p
20
 
21
  p = c_loc(tt%t%i(1))  ! { dg-error "Array section not permitted" }
22
  p = c_loc(n(1:2))  ! { dg-warning "Array section" }
23
  p = c_loc(ttt%t(5,1:2)%i(1)) ! { dg-error "Array section not permitted" }
24
  p = c_loc(x[1]) ! { dg-error "Coindexed argument not permitted" }
25
  end

powered by: WebSVN 2.1.0

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