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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [c_f_pointer_tests_3.f90] - 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
! { dg-options "-O2 -fdump-tree-original" }
3
!
4
! PR fortran/32600 c_f_pointer w/o shape
5
! PR fortran/32580 c_f_procpointer
6
!
7
! Verify that c_f_prointer [w/o shape] and c_f_procpointer generate
8
! the right code - and no library call
9
 
10
program test
11
  use iso_c_binding
12
  implicit none
13
  type(c_ptr)    :: cptr
14
  type(c_funptr) :: cfunptr
15
  integer(4), pointer :: fptr
16
  integer(4), pointer :: fptr_array(:)
17
  procedure(integer(4)), pointer :: fprocptr
18
 
19
  call c_f_pointer(cptr, fptr)
20
  call c_f_pointer(cptr, fptr_array, [ 1 ])
21
  call c_f_procpointer(cfunptr, fprocptr)
22
end program test
23
 
24
! Make sure there is only a single function call:
25
! { dg-final { scan-tree-dump-times "c_f" 1 "original" } }
26
! { dg-final { scan-tree-dump-times "c_f_pointer" 1 "original" } }
27
! { dg-final { scan-tree-dump-times "c_f_pointer_i4" 1 "original" } }
28
!
29
! Check scalar c_f_pointer
30
! { dg-final { scan-tree-dump-times "  fptr = .integer.kind=4. .. cptr" 1 "original" } }
31
!
32
! Check c_f_procpointer
33
! { dg-final { scan-tree-dump-times "  fprocptr = .integer.kind=4. .\\*<.*>. ... cfunptr;" 1 "original" } }
34
!
35
! { dg-final { cleanup-tree-dump "original" } }

powered by: WebSVN 2.1.0

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