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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [pr35983.f90] - Blame information for rev 307

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

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do run }
2
!
3
! PR fortran/35983
4
! C_LOC expanded to a NULL_PTR expr if called from a structure constructor
5
!
6
! Contributed by François-Xavier Coudert
7
 
8
program main
9
   use ISO_C_BINDING
10
   implicit none
11
   type, bind(C) :: descr
12
      type(C_PTR) :: address
13
   end type descr
14
   type(descr) :: DD
15
   double precision, target :: buf(1)
16
   integer (C_INTPTR_T) :: i, j
17
 
18
   buf = (/ 0 /)
19
   DD = descr(c_loc(buf))
20
   i = transfer (DD%address, 0_c_intptr_t)
21
   j = transfer (c_loc(buf), 0_c_intptr_t)
22
   if (any((/ i,j /) == 0_c_intptr_t)) call abort
23
   if (i /= j) call abort
24
end program main

powered by: WebSVN 2.1.0

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